84% modern-related-posts

Code Review | Modern Related Posts

WordPress plugin Modern Related Posts scored84%from 54 tests.

About plugin

  • Plugin page: modern-related-posts
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.2
  • WordPress version: 6.3.1
  • First release: Aug 21, 2014
  • Latest release: Apr 24, 2015
  • Number of updates: 13
  • Update frequency: every 19.0 days
  • Top authors: wphigh (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /8,554 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼5.48ms] Passed 4 tests

Server-side resources used by Modern Related Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1243.61 ▼12.61
Dashboard /wp-admin3.44 ▲0.1447.85 ▼2.05
Posts /wp-admin/edit.php3.56 ▲0.2049.53 ▼3.07
Add New Post /wp-admin/post-new.php6.02 ▲0.1397.71 ▼4.20
Media Library /wp-admin/upload.php3.36 ▲0.1434.68 ▲0.70
Modern Related Posts /wp-admin/options-general.php?page=whp_modern_related_posts3.3332.72

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Modern Related Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲5813.70 ▼0.682.07 ▼0.3140.32 ▼13.27
Dashboard /wp-admin2,210 ▲224.86 ▼1.04111.11 ▲0.7338.46 ▼0.61
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0039.29 ▼3.8037.07 ▲1.39
Add New Post /wp-admin/post-new.php1,545 ▲318.24 ▲0.17626.12 ▲18.2953.03 ▼6.72
Media Library /wp-admin/upload.php1,392 ▲44.22 ▼0.0997.05 ▼8.3843.14 ▼1.44
Modern Related Posts /wp-admin/options-general.php?page=whp_modern_related_posts1,3892.4558.0834.68

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/modern-related-posts/modern-related-posts.php:73

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 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can look at the official readme.txt

modern-related-posts/modern-related-posts.php 92% from 13 tests

The main file in "Modern Related Posts" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin996 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP5160767654
CSS12012181
PO File13232102
JavaScript10047
SVG10012

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity9.40
▷ Minimum class complexity5.00
▷ Maximum class complexity12.00
Average method complexity1.52
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods81
▷ Static methods11.23%
▷ Public methods4758.02%
▷ Protected methods00.00%
▷ Private methods3441.98%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
skins/owl-carousel/grabbing.png0.11KB0.14KB0.00%