10% microkids-related-posts

Code Review | Related Posts for WordPress

WordPress plugin Related Posts for WordPress scored10%from 54 tests.

About plugin

  • Plugin page: microkids-related...
  • Plugin version: 4.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-3.3.1
  • WordPress version: 6.3.1
  • First release: Jun 26, 2008
  • Latest release: Apr 2, 2012
  • Number of updates: 59
  • Update frequency: every 23.3 days
  • Top authors: microkid (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active /81,678 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/microkids-related-posts/microkids-related-posts-widget.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; WP_Widget_Related_Posts has a deprecated constructor

Server metrics [RAM: ▼1.70MB] [CPU: ▼48.62ms] Passed 4 tests

This is a short check of server-side resources used by Related Posts for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.189.00 ▼30.40
Dashboard /wp-admin2.31 ▼0.9910.61 ▼42.28
Posts /wp-admin/edit.php2.31 ▼1.0510.47 ▼35.58
Add New Post /wp-admin/post-new.php2.31 ▼3.5810.87 ▼86.22
Media Library /wp-admin/upload.php2.31 ▼0.9211.46 ▼27.50
Related Posts /wp-admin/options-general.php?page=microkids-related-posts/microkids-related-posts.php2.3111.11

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 20 new files
Database: 1 new table, 9 new options
New tables
wp_post_relationships
New WordPress options
widget_theysaidso_widget
MRP_current_db_version
can_compress_scripts
db_upgraded
widget_recent-posts
MRP_options
widget_related_posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Related Posts for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.26 ▲0.121.85 ▲0.1746.57 ▲0.90
Dashboard /wp-admin2,227 ▲204.88 ▼0.06108.27 ▼0.0242.99 ▼0.91
Posts /wp-admin/edit.php2,106 ▲62.02 ▼0.0233.84 ▼6.9135.10 ▲0.45
Add New Post /wp-admin/post-new.php6,305 ▲4,77426.06 ▲3.04946.48 ▲285.0667.73 ▲10.08
Media Library /wp-admin/upload.php1,409 ▲94.24 ▲0.00101.86 ▼6.4244.15 ▼4.71
Related Posts /wp-admin/options-general.php?page=microkids-related-posts/microkids-related-posts.php1,2141.7225.6736.94

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in WP_Widget_Related_Posts is deprecated since version 4.3.0! Use __construct() instead.
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_post_relationships
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • can_compress_scripts
    • widget_related_posts
    • widget_theysaidso_widget
    • MRP_current_db_version
    • theysaidso_admin_options
    • MRP_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=microkids-related-posts/microkids-related-posts.php
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in WP_Widget_Related_Posts is deprecated since version 4.3.0! Use __construct() instead.

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
Please fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/microkids-related-posts/microkids-related-posts-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/microkids-related-posts/microkids-related-posts.php:18

User-side errors Passed 1 test

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

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
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (The plugin will appear in the write/edit post screen.), #2 (The Related Posts options page allows you to completely customize the way related posts are displayed), #3 (The Related Posts widget lets you automatically display related posts in your dynamic sidebar)
Please take inspiration from this readme.txt

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

The main file in "Related Posts for WordPress" v. 4.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
64 characters long description:
Display a set of manually selected related items with your posts

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,864 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP260226909
PO File5250265576
CSS210284
JavaScript110295

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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 PNG files occupy 0.15MB with 0.08MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png87.50KB35.24KB▼ 59.72%
images/link.png0.44KB0.29KB▼ 34.38%
screenshot-3.png27.19KB11.38KB▼ 58.15%
screenshot-1.png37.89KB15.69KB▼ 58.60%