84% most-liked-posts

Code Review | Most Liked Posts

WordPress plugin Most Liked Posts scored84%from 54 tests.

About plugin

  • Plugin page: most-liked-posts
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Jan 19, 2015
  • Latest release: Jan 19, 2015
  • Number of updates: 5
  • Update frequency: every 1.8 days
  • Top authors: wkrzysztofik (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,058 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.01MB] [CPU: ▼4.15ms] Passed 4 tests

Analyzing server-side resources used by Most Liked Posts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.04 ▲0.39
Dashboard /wp-admin3.32 ▲0.0245.40 ▲0.20
Posts /wp-admin/edit.php3.37 ▲0.0145.29 ▼3.05
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.67 ▼11.24
Media Library /wp-admin/upload.php3.24 ▲0.0133.17 ▼2.51

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_most_liked_posts
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Most Liked Posts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.22 ▼1.181.93 ▼0.0145.74 ▲3.09
Dashboard /wp-admin2,206 ▲214.81 ▼1.03110.47 ▲2.4138.92 ▼4.27
Posts /wp-admin/edit.php2,092 ▲32.03 ▲0.0340.18 ▲6.0835.29 ▼1.81
Add New Post /wp-admin/post-new.php1,534 ▲123.12 ▼0.00647.08 ▼24.8159.77 ▼0.88
Media Library /wp-admin/upload.php1,391 ▲64.19 ▲0.0097.68 ▼3.5542.42 ▼1.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_most_liked_posts

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/most-liked-posts/MostLikedPosts_Widget.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/most-liked-posts/MostLikedPosts.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: like, widget, facebook, popular

most-liked-posts/MostLikedPosts.php 92% from 13 tests

The main PHP script in "Most Liked Posts" version 1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("most-liked-posts.php" instead of "MostLikedPosts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin133 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22247124
CSS1059

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.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
There are no PNG files in this plugin