78% yet-another-related-posts-plugin

Code Review | YARPP - Yet Another Related Posts Plugin

WordPress plugin YARPP - Yet Another Related Posts Plugin scored78%from 54 tests.

About plugin

  • Plugin page: yet-another-relat...
  • Plugin version: 5.30.9
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.4
  • WordPress version: 6.3.1
  • First release: Jan 2, 2008
  • Latest release: Nov 21, 2023
  • Number of updates: 936
  • Update frequency: every 6.2 days
  • Top authors: mitchoyoshitaka (75.96%)jeffparker (20.83%)mnelson4 (3.42%)

Code review

54 tests

User reviews

986 reviews

Install metrics

100,000+ active /7,469,656 total downloads

Benchmarks

Plugin footprint 82% 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.75MB] [CPU: ▲6.07ms] 75% from 4 tests

Analyzing server-side resources used by YARPP - Yet Another Related Posts Plugin
Please take the time to fix the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 646.06ms on /wp-admin/options-general.php?page=yarpp)
PageMemory (MB)CPU Time (ms)
Home /4.13 ▲0.6648.96 ▲7.73
Dashboard /wp-admin4.09 ▲0.7457.51 ▼4.79
Posts /wp-admin/edit.php4.21 ▲0.8558.53 ▲13.23
Add New Post /wp-admin/post-new.php6.70 ▲0.81105.52 ▲10.02
Media Library /wp-admin/upload.php4.02 ▲0.7847.74 ▲11.32
YARPP /wp-admin/options-general.php?page=yarpp4.37646.06

Server storage [IO: ▲2.28MB] [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: 196 new files
Database: 1 new table, 9 new options
New tables
wp_yarpp_related_cache
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
yarpp_pro
widget_theysaidso_widget
widget_yarpp_widget
yarpp_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for YARPP - Yet Another Related Posts Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲714.22 ▼0.121.72 ▼0.1843.93 ▲1.57
Dashboard /wp-admin2,199 ▲195.56 ▼0.0996.82 ▼2.0942.20 ▼2.87
Posts /wp-admin/edit.php2,104 ▲12.03 ▲0.0738.95 ▲1.3435.33 ▼1.43
Add New Post /wp-admin/post-new.php6,453 ▲4,92727.52 ▲3.94997.50 ▲363.6948.67 ▲0.76
Media Library /wp-admin/upload.php1,401 ▼24.26 ▲0.1095.40 ▼0.9640.68 ▼1.18
YARPP /wp-admin/options-general.php?page=yarpp3,5675.45158.5667.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/yet-another-related-posts-plugin/includes/optin_notice.js.php
    • > /wp-content/plugins/yet-another-related-posts-plugin/yarpp.php
  • 35× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function has_fulltext_db_error() on null in wp-content/plugins/yet-another-related-posts-plugin/includes/yarpp_myisam_notice.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/yet-another-related-posts-plugin/includes/template_builtin.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'YARPP_Cache' not found in wp-content/plugins/yet-another-related-posts-plugin/classes/YARPP_Cache_Demo_Bypass.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'YARPP_Meta_Box' not found in wp-content/plugins/yet-another-related-posts-plugin/classes/YARPP_Meta_Box_Relatedness.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'YARPP_Cache' not found in wp-content/plugins/yet-another-related-posts-plugin/classes/YARPP_Cache_Tables.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function enforce() on null in wp-content/plugins/yet-another-related-posts-plugin/includes/template_metabox.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/yet-another-related-posts-plugin/includes/yarpp_pro_options.php:13
    • > PHP Notice
      Trying to get property 'cache' of non-object in wp-content/plugins/yet-another-related-posts-plugin/includes/template_metabox.php on line 4
    • > PHP Notice
      Trying to get property 'db_options' of non-object in wp-content/plugins/yet-another-related-posts-plugin/includes/yarpp_myisam_notice.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'YARPP_Meta_Box' not found in wp-content/plugins/yet-another-related-posts-plugin/classes/YARPP_Meta_Box_Contact.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: similar posts, posts, seo, multilingual, thumbnails...

yet-another-related-posts-plugin/yarpp.php 92% from 13 tests

Analyzing the main PHP file in "YARPP - Yet Another Related Posts Plugin" version 5.30.9
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("yet-another-related-posts-plugin.php" instead of "yarpp.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 detected18,925 lines of code in 137 files:
LanguageFilesBlank linesComment linesLines of code
PO File434,28110,24110,563
PHP691,1031,5976,028
JavaScript10146601,262
CSS13222431,024
SVG20048

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity34.62
▷ Minimum class complexity1.00
▷ Maximum class complexity284.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes14.76%
▷ Concrete classes2095.24%
▷ Final classes00.00%
Methods287
▷ Static methods31.05%
▷ Public methods25388.15%
▷ Protected methods186.27%
▷ Private methods165.57%
Functions29
▷ Named functions2689.66%
▷ Anonymous functions310.34%
Constants29
▷ Global constants1655.17%
▷ Class constants1344.83%
▷ Public constants13100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
12 PNG files occupy 0.19MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/sprites.png5.57KB2.41KB▼ 56.70%
sprites-2x.png16.69KB5.02KB▼ 69.91%
images/default.png56.52KB8.98KB▼ 84.11%
sprites.png5.57KB2.41KB▼ 56.70%
images/preview_thumbnail_example.png3.08KB0.10KB▼ 96.63%