77% related-images

Code Review | Related Images

WordPress plugin Related Images scored77%from 54 tests.

About plugin

  • Plugin page: related-images
  • Plugin version: 2.0b2...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5+
  • WordPress version: 6.3.1
  • First release: Mar 17, 2011
  • Latest release: Aug 19, 2014
  • Number of updates: 31
  • Update frequency: every 40.4 days
  • Top authors: johannesfosseus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,688 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.65MB] [CPU: ▼17.51ms] Passed 4 tests

Analyzing server-side resources used by Related Images
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.75 ▼5.93
Dashboard /wp-admin3.37 ▲0.0649.28 ▲0.73
Posts /wp-admin/edit.php3.48 ▲0.1250.67 ▲3.50
Add New Post /wp-admin/post-new.php3.19 ▼2.7034.17 ▼67.59
Media Library /wp-admin/upload.php3.27 ▲0.0432.83 ▲2.77

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Related Images
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,942 ▲19614.70 ▲0.521.77 ▼0.1241.12 ▼0.81
Dashboard /wp-admin2,351 ▲1666.50 ▲0.69132.52 ▲29.0539.65 ▲0.28
Posts /wp-admin/edit.php2,251 ▲1623.30 ▲1.2756.92 ▲16.6233.93 ▲0.34
Add New Post /wp-admin/post-new.php6,250 ▲4,73125.92 ▲2.63901.55 ▲248.8741.51 ▼5.93
Media Library /wp-admin/upload.php1,387 ▼44.19 ▼0.0283.95 ▼17.6641.30 ▼2.39

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/related-images/tpl/meta-box.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: related_images in wp-content/plugins/related-images/tpl/meta-box.php on line 67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function RI\\add_action() in wp-content/plugins/related-images/inc/class-backend.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/related-images/related-images.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (Box where you add and position images to a post)
  • Tested up to: Invalid version format
Please take inspiration from this readme.txt

related-images/related-images.php 85% from 13 tests

The main PHP file in "Related Images" ver. 2.0b2... adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "2.0b2...")
  • Description: Please don't use more than 140 characters for the plugin description (currently 158 characters long)

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
Success! There were no dangerous files found in this plugin668 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP8283173549
JavaScript24624112
CSS1007

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity10.83
▷ Minimum class complexity2.00
▷ Maximum class complexity36.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods43
▷ Static methods613.95%
▷ Public methods4093.02%
▷ Protected methods24.65%
▷ Private methods12.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png23.17KB7.85KB▼ 66.13%