84% most-popular-post

Code Review | Most Popular Post Widget

WordPress plugin Most Popular Post Widget scored84%from 54 tests.

About plugin

  • Plugin page: most-popular-post
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.5
  • WordPress version: 6.3.1
  • First release: Oct 7, 2016
  • Latest release: Nov 5, 2020
  • Number of updates: 66
  • Update frequency: every 22.6 days
  • Top authors: quazisazzad (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

700+ active /10,528 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.12ms] Passed 4 tests

Server-side resources used by Most Popular Post Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0548.64 ▲3.27
Dashboard /wp-admin3.35 ▲0.0556.32 ▲3.04
Posts /wp-admin/edit.php3.40 ▲0.0552.97 ▼3.17
Add New Post /wp-admin/post-new.php5.93 ▲0.0597.03 ▼8.21
Media Library /wp-admin/upload.php3.28 ▲0.0534.94 ▼4.15

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_most_popular_post_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Most Popular Post Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.34 ▼0.212.05 ▲0.1140.74 ▼5.39
Dashboard /wp-admin2,198 ▲215.62 ▲0.0285.25 ▼17.0937.57 ▼8.38
Posts /wp-admin/edit.php2,097 ▼62.00 ▲0.0339.40 ▲4.6137.47 ▲0.19
Add New Post /wp-admin/post-new.php1,526 ▼223.18 ▲0.17603.45 ▼81.6762.22 ▲4.29
Media Library /wp-admin/upload.php1,403 ▲34.18 ▼0.07100.40 ▼8.0543.47 ▼5.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_most_popular_post_widget
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

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 | 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
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/most-popular-post/includes/views_posts.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/most-popular-post/includes/popular-post_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/most-popular-post/includes/popular-post-script.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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
2 plugin tags: most viewed post, most popular post

most-popular-post/popular-post.php 92% from 13 tests

Analyzing the main PHP file in "Most Popular Post Widget" version 2.3
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("most-popular-post.php" instead of "popular-post.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
Good job! No executable or dangerous file extensions detected247 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP45331205
CSS17042

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity7.50
▷ Minimum method complexity1.00
▷ Maximum method complexity11.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%
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
PNG images were not found in this plugin