62% yydevelopment-related-posts

Code Review | Advanced Related Posts

WordPress plugin Advanced Related Posts scored62%from 54 tests.

About plugin

  • Plugin page: yydevelopment-rel...
  • Plugin version: 2.2.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 20, 2019
  • Latest release: Aug 21, 2023
  • Number of updates: 57
  • Update frequency: every 25.1 days
  • Top authors: yydevelopment (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /2,332 total downloads

Benchmarks

Plugin footprint 65% 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 gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼4.47ms] Passed 4 tests

Server-side resources used by Advanced Related Posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0839.52 ▼9.82
Dashboard /wp-admin3.40 ▲0.0948.31 ▼3.93
Posts /wp-admin/edit.php3.51 ▲0.1651.03 ▼1.22
Add New Post /wp-admin/post-new.php5.98 ▲0.1091.42 ▼2.89
Media Library /wp-admin/upload.php3.32 ▲0.0939.76 ▲3.40
Settings /wp-admin/admin.php?page=yydev-related-posts-settings3.3435.00
Related Posts /wp-admin/admin.php?page=yydev-related-posts3.3444.30

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: 2 new tables, 9 new options
New tables
wp_yy_related_post
wp_yy_related_posts
New WordPress options
can_compress_scripts
yydev_related_wordpress_boxes
yydev_related_posts_settings
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
yy_related_posts_timestamp
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Related Posts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲5713.60 ▼0.821.83 ▼0.2140.02 ▼5.44
Dashboard /wp-admin2,244 ▲445.84 ▼0.0498.51 ▼20.8380.35 ▲35.12
Posts /wp-admin/edit.php2,123 ▲202.01 ▲0.0038.36 ▼3.7237.91 ▲1.93
Add New Post /wp-admin/post-new.php6,350 ▲4,80119.11 ▼4.27892.11 ▲243.5767.35 ▲20.37
Media Library /wp-admin/upload.php1,420 ▲174.22 ▲0.04107.42 ▲5.3871.91 ▲24.20
Settings /wp-admin/admin.php?page=yydev-related-posts-settings1,1293.0738.9968.13
Related Posts /wp-admin/admin.php?page=yydev-related-posts8892.0827.5531.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie tables detected upon uninstall: 2 tables
    • wp_yy_related_posts
    • wp_yy_related_post
  • This plugin does not fully uninstall, leaving 9 options in the database
    • yy_related_posts_timestamp
    • yydev_related_wordpress_boxes
    • db_upgraded
    • yydev_related_posts_settings
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=yydev-related-posts-settings
    • > Notice in wp-content/plugins/yydevelopment-related-posts/include/admin-settings-page.php+114
    Undefined variable: post_error_message
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=yydev-related-posts-settings
    • > Notice in wp-content/plugins/yydevelopment-related-posts/include/admin-settings-page.php+149
    Undefined index: hide_post_type

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/yydevelopment-related-posts/include/script.php
    • > /wp-content/plugins/yydevelopment-related-posts/include/style.php
  • 20× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/yydevelopment-related-posts/include/settings.php on line 5
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/yydevelopment-related-posts/include/settings.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/yydevelopment-related-posts/include/settings.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yydevelopment-related-posts/include/ajax-functions.php:23
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/yydevelopment-related-posts/include/settings.php on line 5
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/yydevelopment-related-posts/include/settings.php on line 5
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/yydevelopment-related-posts/include/settings.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/yydevelopment-related-posts/include/settings.php:35
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/yydevelopment-related-posts/include/settings.php on line 4
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/yydevelopment-related-posts/include/settings.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Requires at least: Invalid plugin version format
You can look at the official readme.txt

yydevelopment-related-posts/index.php 92% from 13 tests

The main PHP script in "Advanced Related Posts" version 2.2.0 is automatically included on every request by WordPress
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 ("yydevelopment-related-posts.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,041 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP168614381,956
CSS123785

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/favicon.png0.37KB0.38KB0.00%
images/add-image.png12.71KB5.07KB▼ 60.12%
images/icon.png8.50KB2.82KB▼ 66.87%