84% perfect-related-posts

Code Review | Perfect related posts

WordPress plugin Perfect related posts scored84%from 54 tests.

About plugin

  • Plugin page: perfect-related-p...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4
  • WordPress version: 6.3.1
  • First release: Jul 10, 2015
  • Latest release: Feb 10, 2016
  • Number of updates: 26
  • Update frequency: every 8.3 days
  • Top authors: amrinder146 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /853 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.74ms] Passed 4 tests

This is a short check of server-side resources used by Perfect related posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.81 ▲1.84
Dashboard /wp-admin3.32 ▼0.0248.07 ▼17.67
Posts /wp-admin/edit.php3.37 ▲0.0149.91 ▼0.36
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.27 ▼17.78
Media Library /wp-admin/upload.php3.24 ▲0.0139.02 ▲0.87

Server storage [IO: ▲0.01MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please fix the following
  • There were 1 file (4.00KB) illegally modified outside of "wp-content/plugins/perfect-related-posts/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Perfect related posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲7614.47 ▲0.191.89 ▲0.0745.94 ▲0.75
Dashboard /wp-admin2,234 ▲275.05 ▲0.17104.21 ▼5.3741.64 ▼3.75
Posts /wp-admin/edit.php2,116 ▲161.99 ▼0.0237.99 ▼2.2634.49 ▼1.67
Add New Post /wp-admin/post-new.php1,558 ▲2722.83 ▼0.36649.50 ▼10.1049.64 ▼5.78
Media Library /wp-admin/upload.php1,416 ▲194.29 ▲0.09102.69 ▲2.4146.75 ▼2.00

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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 trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/perfect-related-posts/index.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/perfect-related-posts/admin/perfect-related-admin.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

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
4 plugin tags: categories, related, posts, perfect

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

The main PHP script in "Perfect related posts" version 1.0.5 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("perfect-related-posts.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin100 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2272181
CSS11019

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.15
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%
Functions5
▷ Named functions5100.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
No PNG images were found in this plugin