78% advanced-related-posts

Code Review | Advanced Related Posts

WordPress plugin Advanced Related Posts scored 78% from 54 tests.

About plugin

  • Plugin page: advanced-related-...
  • Plugin version: 1.1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 5.9.2
  • First release: Apr 27, 2021
  • Latest release: Feb 3, 2022
  • Number of updates: 44
  • Update frequency: every 6.4 days
  • Top authors: ays-pro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 799 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.13MB] [CPU: ▼289.04ms] Passed 4 tests

Analyzing server-side resources used by Advanced Related Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1555.59 ▲6.65
Dashboard /wp-admin3.53 ▲0.1231.74 ▼1.17
Posts /wp-admin/edit.php3.74 ▲0.1042.36 ▲7.35
Add New Post /wp-admin/post-new.php7.37 ▲0.3792.98 ▼1,158.99
Media Library /wp-admin/upload.php3.43 ▲0.1420.91 ▼2.66
Our products /wp-admin/admin.php?page=advanced-related-posts-featured-plugins3.5325.02
PRO Features /wp-admin/admin.php?page=advanced-related-posts-related-posts-features3.5186.17
Display after post /wp-admin/admin.php?page=advanced-related-posts3.8433.42
Widget settings /wp-admin/admin.php?page=advanced-related-posts-wiget-settings3.8232.49

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 143 new files
Database: 1 new table, 2 new options
New tables
wp_aysarp_settings
New WordPress options
ays_advanced_related_posts_db_version
widget_advanced_related_posts

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Related Posts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,943 ▲21716.24 ▲0.279.61 ▲3.552.14 ▼0.42
Dashboard /wp-admin2,935 ▲816.23 ▲0.07114.85 ▼19.01167.51 ▲6.58
Posts /wp-admin/edit.php2,729 ▲353.23 ▼0.0166.93 ▲2.67140.74 ▼3.06
Add New Post /wp-admin/post-new.php1,759 ▲9819.24 ▲3.08384.15 ▼28.45204.45 ▲51.13
Media Library /wp-admin/upload.php1,738 ▲435.52 ▲0.01121.21 ▼56.42197.58 ▲2.41
Our products /wp-admin/admin.php?page=advanced-related-posts-featured-plugins2,0977.4799.88206.22
PRO Features /wp-admin/admin.php?page=advanced-related-posts-related-posts-features2,1977.5597.30190.19
Display after post /wp-admin/admin.php?page=advanced-related-posts6,67111.08226.84215.59
Widget settings /wp-admin/admin.php?page=advanced-related-posts-wiget-settings6,56310.97225.69199.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_advanced_related_posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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 items
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/advanced-related-posts/admin/partials/advanced-related-posts-admin-display.php
    • > /wp-content/plugins/advanced-related-posts/admin/partials/settings/advanced-related-posts-settings-admin-display.php
    • > /wp-content/plugins/advanced-related-posts/admin/partials/under-posts/advanced-related-under-posts-admin-display.php
    • > /wp-content/plugins/advanced-related-posts/public/partials/advanced-related-posts-public-display.php
  • 42× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/advanced-related-posts/admin/partials/settings/actions/partials/advanced-related-posts-settings-actions-tab1.php:2
    • > PHP Warning
      require_once(ADVANCED_RELATED_POSTS_ADMIN_PATH/partials/under-posts/actions/advanced-related-posts-under-posts-actions-options.php): failed to open stream: No such file or directory in wp-content/plugins/advanced-related-posts/admin/partials/under-posts/actions/advanced-related-posts-under-posts-actions.php on line 2
    • > PHP Warning
      require_once(ADVANCED_RELATED_POSTS_ADMIN_PATH/partials/settings/actions/advanced-related-posts-settings-actions-options.php): failed to open stream: No such file or directory in wp-content/plugins/advanced-related-posts/admin/partials/settings/actions/advanced-related-posts-settings-actions.php on line 2
    • > PHP Notice
      Undefined variable: class_prefix in wp-content/plugins/advanced-related-posts/admin/partials/under-posts/actions/partials/advanced-related-posts-under-posts-actions-tab1.php on line 1
    • > PHP Notice
      Undefined variable: ays_tab in wp-content/plugins/advanced-related-posts/admin/partials/settings/actions/partials/advanced-related-posts-settings-actions-tab4.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/advanced-related-posts/admin/partials/under-posts/actions/partials/advanced-related-posts-under-posts-actions-tab4.php:2
    • > PHP Notice
      Undefined variable: ays_tab in wp-content/plugins/advanced-related-posts/admin/partials/under-posts/actions/partials/advanced-related-posts-under-posts-actions-tab1.php on line 1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/advanced-related-posts/includes/metabox/advanced-related-posts-metabox.php:151
    • > PHP Fatal error
      Uncaught Error: Class 'Advanced_Related_Posts_Widget' not found in wp-content/plugins/advanced-related-posts/widget/partials/class-advanced-related-posts-widget-elegant-layout.php:31
    • > PHP Notice
      Undefined variable: class_prefix in wp-content/plugins/advanced-related-posts/admin/partials/under-posts/actions/partials/advanced-related-posts-under-posts-actions-tab2.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention: You can look at the official readme.txt

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

The main PHP file in "Advanced Related Posts" ver. 1.1.9 adds more information about the plugin and also serves as the entry point for this plugin
96 characters long description:
This is a short description of what the plugin does. It's displayed in the WordPress admin area.

Code Analysis 97% from 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
There were no executable files found in this plugin12,582 lines of code in 85 files:
LanguageFilesBlank linesComment linesLines of code
PHP361,7572,0806,783
SVG17032,841
CSS183101711,978
JavaScript14153131980

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 231)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity65.47
▷ Minimum class complexity1.00
▷ Maximum class complexity332.00
Average method complexity10.00
▷ Minimum method complexity1.00
▷ Maximum method complexity231.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods117
▷ Static methods1714.53%
▷ Public methods9984.62%
▷ Protected methods1311.11%
▷ Private methods54.27%
Functions13
▷ Named functions538.46%
▷ Anonymous functions861.54%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
41 PNG files occupy 0.82MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/themes/elegant_theme_under_posts250.png5.16KB2.67KB▼ 48.27%
admin/images/integrations/slack_logo.png2.33KB1.87KB▼ 19.83%
admin/images/black_friday_greate_bundle_mobile.png18.39KB18.43KB0.00%
admin/images/winter_bundle_logo_background_2.png357.75KB171.13KB▼ 52.16%
admin/images/icons/users2.png1.30KB1.53KB0.00%