72% most-and-least-read-posts-widget

Code Review | Most And Least Read Posts Widget

WordPress plugin Most And Least Read Posts Widget scored72%from 54 tests.

About plugin

  • Plugin page: most-and-least-re...
  • Plugin version: 2.5.17
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 8, 2011
  • Latest release: Nov 4, 2023
  • Number of updates: 73
  • Update frequency: every 61.6 days
  • Top authors: whiletrue (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /82,926 total downloads

Benchmarks

Plugin footprint 82% 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.03MB] [CPU: ▼1.68ms] 75% from 4 tests

Server-side resources used by Most And Least Read Posts Widget
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 860.14ms on /wp-admin/options-general.php?page=most_and_least_read_posts_options)
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.67 ▼4.41
Dashboard /wp-admin3.33 ▲0.0347.77 ▲0.30
Posts /wp-admin/edit.php3.38 ▲0.0349.43 ▲2.04
Add New Post /wp-admin/post-new.php5.91 ▲0.0289.80 ▼4.65
Media Library /wp-admin/upload.php3.25 ▲0.0236.33 ▲4.27
Most read posts /wp-admin/options-general.php?page=most_and_least_read_posts_options4.43860.14

Server storage [IO: ▲0.04MB] [DB: ▲0.06MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 9 new options
New WordPress options
most_and_least_read_posts
can_compress_scripts
widget_mostreadpostswidget
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_leastreadpostswidget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Most And Least Read Posts Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3214.27 ▼0.071.81 ▲0.0844.44 ▼0.12
Dashboard /wp-admin2,199 ▲195.61 ▲0.0689.43 ▲1.7937.70 ▼4.52
Posts /wp-admin/edit.php2,111 ▲111.97 ▲0.0340.47 ▲2.4838.72 ▲4.29
Add New Post /wp-admin/post-new.php1,534 ▲822.93 ▼0.23569.86 ▼102.7249.87 ▼2.39
Media Library /wp-admin/upload.php1,404 ▲134.28 ▲0.1696.37 ▼2.8840.89 ▼5.97
Most read posts /wp-admin/options-general.php?page=most_and_least_read_posts_options1,0131.9924.9030.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_leastreadpostswidget
    • widget_mostreadpostswidget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • most_and_least_read_posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=most_and_least_read_posts_options
    • > Notice in wp-content/plugins/most-and-least-read-posts-widget/most_and_least_read_posts.php+414
    Undefined variable: out

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/most-and-least-read-posts-widget/uninstall.php
  • 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/most-and-least-read-posts-widget/most_and_least_read_posts.php:22

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

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
  • Requires at least: Version format is invalid
The official readme.txt is a good inspiration

most-and-least-read-posts-widget/most_and_least_read_posts.php 92% from 13 tests

The main file in "Most And Least Read Posts Widget" v. 2.5.17 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("most-and-least-read-posts-widget.php" instead of "most_and_least_read_posts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin571 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP310661571

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.50
▷ Minimum class complexity6.00
▷ Maximum class complexity11.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions1487.50%
▷ Anonymous functions212.50%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin