78% usp-ai

Code Review | USP AI

WordPress plugin USP AI scored 78% from 54 tests.

About plugin

  • Plugin page: usp-ai
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 5, 2023
  • Latest release: Feb 7, 2023
  • Number of updates: 8
  • Update frequency: every 4.1 days
  • Top authors: uspai (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 593 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼5.53ms] Passed 4 tests

An overview of server-side resources used by USP AI
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0840.35 ▲0.80
Dashboard /wp-admin3.37 ▲0.0748.65 ▼0.68
Posts /wp-admin/edit.php3.42 ▲0.0743.29 ▼2.44
Add New Post /wp-admin/post-new.php5.97 ▲0.0983.80 ▼14.11
Media Library /wp-admin/upload.php3.29 ▲0.0632.00 ▼4.88
Generate AI Images /wp-admin/upload.php?page=generate-usp-ai-images3.2630.13

Server storage [IO: ▲0.10MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

USP AI: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲11713.30 ▼0.862.51 ▲0.9746.72 ▲6.55
Dashboard /wp-admin2,237 ▲454.94 ▼0.0297.87 ▼14.4038.65 ▼0.53
Posts /wp-admin/edit.php2,120 ▲452.10 ▲0.0639.46 ▲2.3733.79 ▼0.28
Add New Post /wp-admin/post-new.php6,612 ▲5,09822.26 ▲4.76947.07 ▲258.9941.85 ▼21.21
Media Library /wp-admin/upload.php1,415 ▲304.38 ▲0.18104.24 ▲1.7748.35 ▲4.21
Generate AI Images /wp-admin/upload.php?page=generate-usp-ai-images1,2752.1629.0354.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/usp-ai/wp-ajax/wp-usp-image-genarator-ajax.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/usp-ai/usp-ai-image-generator.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://d1okzptojspljx.cloudfront.net/generations/822500081675114298.png - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://d1okzptojspljx.cloudfront.net/generations/20313028851675529498.png - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://d1okzptojspljx.cloudfront.net/generations/445823791675281138.png - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://d1okzptojspljx.cloudfront.net/generations/14853540911669470514.png - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://d1okzptojspljx.cloudfront.net/generations/2092599771675173103.png - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://d1okzptojspljx.cloudfront.net/generations/9782515001675014614.png - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://d1okzptojspljx.cloudfront.net/generations/14779611201675081298.png - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://stablediffusionapi.com//storage/generations/exposure.jpg - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://stablediffusionapi.com//storage/generations/logo.png - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://stablediffusionapi.com//storage/generations/vintedois.png - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://stablediffusionapi.com//storage/generations/nightDiffusion.jpg - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://stablediffusionapi.com//storage/generations/MidjourneyV2.jpg - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://stablediffusionapi.com//storage/generations/portrait.jpg - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://stablediffusionapi.com//storage/generations/protogen.jpg - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://s3.amazonaws.com/moonup/production/uploads/1670018139245-635eafb49f24f6db0a1eafd1.png - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/upload.php?page=generate-usp-ai-images
    • > Network (severe)
    https://s3.amazonaws.com/moonup/production/uploads/1668139335005-633a520aecbd8b19357b4806.png - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Contributors: Plugin contributors not specified
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5, #6, #7 in usp-ai/assets to your readme.txt
You can look at the official readme.txt

usp-ai/usp-ai-image-generator.php 92% from 13 tests

The principal PHP file in "USP AI" v. 1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("usp-ai.php" instead of "usp-ai-image-generator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,048 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS3805546
PHP33818298
JavaScript285173
JSON10031

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 compressed PNG files occupy 0.01MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/crown-icon.png1.90KB1.89KB▼ 0.51%
build/images/logo.b7e8ca61.png1.47KB1.34KB▼ 9.02%
assets/logo.png1.47KB1.34KB▼ 9.02%
build/images/crown-icon.27dd1b7c.png1.90KB1.89KB▼ 0.51%