78% most-read-posts-in-x-days

Code Review | Most read posts in X days

WordPress plugin Most read posts in X days scored78%from 54 tests.

About plugin

  • Plugin page: most-read-posts-i...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0.2
  • WordPress version: 6.3.1
  • First release: Oct 15, 2022
  • Latest release: Jun 11, 2023
  • Number of updates: 18
  • Update frequency: every 13.3 days
  • Top authors: ashique12009 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /210 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.99ms] Passed 4 tests

An overview of server-side resources used by Most read posts in X days
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.55 ▲4.92
Dashboard /wp-admin3.32 ▲0.0247.06 ▲4.23
Posts /wp-admin/edit.php3.37 ▲0.0244.57 ▼1.61
Add New Post /wp-admin/post-new.php5.92 ▲0.0482.73 ▼19.48
Media Library /wp-admin/upload.php3.24 ▲0.0235.94 ▲4.99
Most read posts /wp-admin/options-general.php?page=most-read-posts-settings3.2632.48

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 28 new files
Database: 1 new table, 6 new options
New tables
wp_ashique_most_read_posts
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Most read posts in X days
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲14513.96 ▼0.315.44 ▲3.7749.83 ▲6.24
Dashboard /wp-admin2,214 ▲264.86 ▼0.99109.53 ▲9.4643.59 ▼0.11
Posts /wp-admin/edit.php2,097 ▲292.00 ▲0.0136.17 ▼3.1733.47 ▼0.31
Add New Post /wp-admin/post-new.php1,521 ▼2523.13 ▲4.91680.58 ▲74.1979.13 ▲26.04
Media Library /wp-admin/upload.php1,396 ▲54.20 ▼0.0499.97 ▲4.0742.76 ▼2.84
Most read posts /wp-admin/options-general.php?page=most-read-posts-settings8322.0624.8829.68

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% 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 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
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/most-read-posts-in-x-days/admin/partials/ashique-most-read-admin-display.php
    • > /wp-content/plugins/most-read-posts-in-x-days/public/partials/ashique-most-read-public-display.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/most-read-posts-in-x-days/admin/partials/ashique-most-read-admin-posts-log-page.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/most-read-posts-in-x-days/admin/partials/ashique-most-read-admin-posts-log-sum-page.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: popular-post, most read posts, most-read, most-read-posts, trending-posts

most-read-posts-in-x-days/ashique-most-read.php 85% from 13 tests

The principal PHP file in "Most read posts in X days" v. 1.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("most-read-posts-in-x-days.php" instead of "ashique-most-read.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin596 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP15211596550
CSS21840
JavaScript24546

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.68
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods40
▷ Static methods25.00%
▷ Public methods3382.50%
▷ Protected methods00.00%
▷ Private methods717.50%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
3 PNG files occupy 0.28MB with 0.16MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png260.13KB101.85KB▼ 60.85%
public/images/default-image.png2.49KB0.80KB▼ 67.92%
assets/screenshot-2.png24.72KB13.36KB▼ 45.97%