78% yay-images

Code Review | YAY Images

WordPress plugin YAY Images scored78%from 54 tests.

About plugin

  • Plugin page: yay-images
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4
  • WordPress version: 6.3.1
  • First release: Jul 25, 2014
  • Latest release: Jan 21, 2016
  • Number of updates: 45
  • Update frequency: every 12.1 days
  • Top authors: yaybjorn (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /3,518 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.10MB] [CPU: ▼9.76ms] Passed 4 tests

Server-side resources used by YAY Images
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0335.33 ▼3.76
Dashboard /wp-admin3.32 ▲0.0245.22 ▼4.30
Posts /wp-admin/edit.php3.37 ▲0.0249.24 ▼2.72
Add New Post /wp-admin/post-new.php5.45 ▼0.4369.52 ▼28.25
Media Library /wp-admin/upload.php3.24 ▲0.0234.31 ▲0.87
Yay Images /wp-admin/options-general.php?page=YayimagesPlugin3.2434.55

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 58 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
YayimagesPlugin_apiAppToken_e6d48dcd6a531191255a14beb5bdf80a
db_upgraded
theysaidso_admin_options
YayimagesPlugin_freeImagesCounter
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

YAY Images: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,915 ▲18013.66 ▼0.877.13 ▲5.6237.57 ▼4.48
Dashboard /wp-admin2,210 ▲225.79 ▼0.06101.02 ▼3.3340.07 ▼4.65
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0339.96 ▼0.4236.09 ▼1.15
Add New Post /wp-admin/post-new.php1,555 ▲3623.34 ▲0.16648.46 ▲31.7237.10 ▼11.22
Media Library /wp-admin/upload.php1,392 ▲14.27 ▲0.0991.69 ▼10.4040.27 ▼3.98
Yay Images /wp-admin/options-general.php?page=YayimagesPlugin8472.0726.7625.71

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • can_compress_scripts
    • YayimagesPlugin_apiAppToken_e6d48dcd6a531191255a14beb5bdf80a
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • YayimagesPlugin_freeImagesCounter

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/yay-images/views/partials/photonavi.php
    • > /wp-content/plugins/yay-images/views/partials/photographerimages.php
    • > /wp-content/plugins/yay-images/views/partials/similarimages.php
    • > /wp-content/plugins/yay-images/views/photodetailskeywords.php
  • 40× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/yay-images/yayimages.php:17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/yay-images/views/partials/photographerimages.php on line 21
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/yay-images/views/photodetailskeywords.php on line 1
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/yay-images/views/partials/similarimages.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/yay-images/views/partials/help.php:3
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/yay-images/views/partials/similarimages.php on line 17
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/yay-images/views/photodetailskeywords.php on line 1
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/yay-images/views/partials/photographerimages.php on line 22
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/yay-images/views/photodetails.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/yay-images/views/photodetailsadditional.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

yay-images/yayimages.php 92% from 13 tests

The principal PHP file in "YAY Images" v. 1.1.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("yay-images.php" instead of "yayimages.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected5,797 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
Sass7765902,860
JavaScript6177281,537
PHP20272701,239
CSS2273129
JSON10029
Markdown1103

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity14.50
▷ Minimum class complexity3.00
▷ Maximum class complexity33.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods57
▷ Static methods58.77%
▷ Public methods4680.70%
▷ Protected methods610.53%
▷ Private methods58.77%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ Public constants3100.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
17 PNG files occupy 0.31MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/yay-minilogo.png2.66KB0.84KB▼ 68.31%
images/w-t-bg.png0.13KB0.09KB▼ 25.78%
images/bg-noise.png5.59KB3.06KB▼ 45.31%
images/arrows.png0.24KB0.24KB0.00%
images/check-icons.png1.17KB0.77KB▼ 34.20%