84% related-posts-thumbnails

Code Review | Related Posts Thumbnails Plugin for WordPress

WordPress plugin Related Posts Thumbnails Plugin for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: related-posts-thu...
  • Plugin version: 3.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.4
  • WordPress version: 6.3.1
  • First release: May 21, 2010
  • Latest release: Nov 14, 2023
  • Number of updates: 90
  • Update frequency: every 54.7 days
  • Top authors: hiddenpearls (54.44%)marynixie (46.67%)

Code review

54 tests

User reviews

208 reviews

Install metrics

30,000+ active /804,082 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
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.80ms] Passed 4 tests

Analyzing server-side resources used by Related Posts Thumbnails Plugin for WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0542.20 ▼2.67
Dashboard /wp-admin3.34 ▼0.0144.38 ▼15.40
Posts /wp-admin/edit.php3.39 ▲0.0341.49 ▼6.28
Add New Post /wp-admin/post-new.php5.92 ▲0.0385.07 ▼6.85
Media Library /wp-admin/upload.php3.26 ▲0.0333.11 ▲4.01

Server storage [IO: ▲0.50MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 38 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
can_compress_scripts
rpt_active_time
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_relatedpoststhumbnailswidget
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Related Posts Thumbnails Plugin for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲6414.24 ▲0.101.74 ▲0.0643.44 ▲0.87
Dashboard /wp-admin2,211 ▲335.61 ▼0.0192.58 ▼11.6637.56 ▼1.86
Posts /wp-admin/edit.php2,119 ▲161.96 ▼0.0139.35 ▼1.5234.83 ▲0.42
Add New Post /wp-admin/post-new.php6,209 ▲4,68319.20 ▼4.31908.24 ▲196.3851.92 ▼7.09
Media Library /wp-admin/upload.php1,407 ▲134.15 ▼0.0798.94 ▼9.2942.36 ▼4.74

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_relatedpoststhumbnailswidget
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • rpt_active_time

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/related-posts-thumbnails/inc/rpt-widget.php:17
    • > PHP Notice
      Undefined variable: product_slug in wp-content/plugins/related-posts-thumbnails/lib/wpb-sdk/views/wpb-sdk-deactivate-form.php on line 103
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/related-posts-thumbnails/related-posts-thumbnails.php:276
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/related-posts-thumbnails/inc/rpt-settings.php:220
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/related-posts-thumbnails/lib/wpb-sdk/views/wpb-sdk-deactivate-form.php:109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/related-posts-thumbnails/inc/rpt-blocks.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention: You can look at the official readme.txt

related-posts-thumbnails/related-posts-thumbnails.php Passed 13 tests

Analyzing the main PHP file in "Related Posts Thumbnails Plugin for WordPress" version 3.0.1
49 characters long description:
Showing related posts thumbnails under the posts.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin5,515 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP84815262,442
CSS459461,464
PO File63812,016866
JavaScript4117299646
SVG30097

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 115)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity57.50
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity6.02
▷ Minimum method complexity1.00
▷ Maximum method complexity115.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods45
▷ Static methods920.00%
▷ Public methods3986.67%
▷ Protected methods00.00%
▷ Private methods613.33%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/chosen-sprite@2x.png0.72KB0.83KB0.00%
assets/images/icons.png12.69KB5.00KB▼ 60.61%
assets/css/chosen-sprite.png0.53KB0.88KB0.00%
img/default.png4.47KB2.35KB▼ 47.52%
assets/css/chosen-sprite@2x.png0.53KB0.88KB0.00%