74% magadanski-similar-posts

Code Review | M Similar Posts

WordPress plugin M Similar Posts scored74%from 54 tests.

About plugin

  • Plugin page: magadanski-simila...
  • Plugin version: 1.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.0
  • WordPress version: 6.3.1
  • First release: Oct 22, 2013
  • Latest release: Jul 7, 2022
  • Number of updates: 92
  • Update frequency: every 34.6 days
  • Top authors: magadanski_uchen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /7,905 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼1.79MB] [CPU: ▼53.93ms] Passed 4 tests

Server-side resources used by M Similar Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.21 ▼1.266.01 ▼32.21
Dashboard /wp-admin2.23 ▼1.1211.21 ▼47.28
Posts /wp-admin/edit.php2.23 ▼1.138.70 ▼42.15
Add New Post /wp-admin/post-new.php2.23 ▼3.669.11 ▼94.06
Media Library /wp-admin/upload.php2.23 ▼1.008.36 ▼26.00

Server storage [IO: ▲0.32MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 26 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_magadanski_similar_posts_widget
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for M Similar Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.33 ▲0.051.86 ▲0.3743.57 ▲1.80
Dashboard /wp-admin2,202 ▲225.58 ▼0.0889.23 ▲1.6338.37 ▼4.38
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0940.41 ▲2.4035.74 ▼2.33
Add New Post /wp-admin/post-new.php6,369 ▲4,83227.78 ▲9.36903.63 ▲259.4769.96 ▲1.40
Media Library /wp-admin/upload.php1,398 ▼54.12 ▼0.0595.09 ▲0.4241.21 ▼2.56

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the msp-block handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_magadanski_similar_posts_widget
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/magadanski-similar-posts/Magadanski_Similar_Posts_Widget.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/magadanski-similar-posts/Magadanski_Similar_Posts_Widget.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: posts, category, similar

magadanski-similar-posts/magadanski-similar-posts.php Passed 13 tests

The primary PHP file in "M Similar Posts" version 1.3.4 is used by WordPress to initiate all plugin functionality
63 characters long description:
Shows similar posts ordered by the number of common categories.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin7,659 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JSON3006,918
PHP3109282367
PO File36069184
JavaScript5260174
CSS24016

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity16.00
▷ Minimum class complexity13.00
▷ Maximum class complexity19.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods14.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/logo@2x.png1.34KB0.53KB▼ 60.39%
img/logo.png1.20KB0.36KB▼ 69.80%