10% wp-posts-most-read

Code Review | Name: WP Posts Most Read

WordPress plugin Name: WP Posts Most Read scored 10% from 54 tests.

About plugin

  • Plugin page: wp-posts-most-read
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5.1
  • WordPress version: 5.8.1
  • First release: Feb 26, 2013
  • Latest release: Feb 28, 2013
  • Number of updates: 12
  • Update frequency: every 0.2 days
  • Top authors: iziwebavenir (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,138 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wp-posts-most-read/PMRposts.php+586
    Function create_function() is deprecated

Server metrics [RAM: ▼1.89MB] [CPU: ▼186.22ms] Passed 4 tests

Server-side resources used by Name: WP Posts Most Read
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.74 ▼1.096.54 ▼27.86
Dashboard /wp-admin1.76 ▼1.296.01 ▼40.79
Posts /wp-admin/edit.php1.76 ▼1.356.22 ▼33.48
Add New Post /wp-admin/post-new.php1.76 ▼3.675.91 ▼642.75
Media Library /wp-admin/upload.php1.76 ▼1.246.89 ▼22.58
Posts Most Read /wp-admin/options-general.php?page=wp-postsmostread-option1.766.47

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 25 new files
Database: 1 new table, 2 new options
New tables
wp_posts_most_read
New WordPress options
wp-postsmostread-opt-view-last-reset
widget_pmrpostswidget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Name: WP Posts Most Read
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,707 ▲11115.66 ▲0.1310.43 ▼0.6843.72 ▼2.77
Dashboard /wp-admin2,985 ▲545.92 ▼0.25139.08 ▼66.41118.94 ▲1.96
Posts /wp-admin/edit.php2,780 ▲412.72 ▼0.0066.54 ▲1.2589.82 ▲0.09
Add New Post /wp-admin/post-new.php1,701 ▲9518.75 ▼0.08392.81 ▲4.25104.25 ▼5.46
Media Library /wp-admin/upload.php1,774 ▼334.99 ▼0.02137.52 ▼14.16132.17 ▲16.45
Posts Most Read /wp-admin/options-general.php?page=wp-postsmostread-option1,5202.1056.02116.26

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/wp-posts-most-read/PMRposts.php+586
    Function create_function() is deprecated
  • Zombie tables were found after uninstall: 1 table
    • wp_posts_most_read
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_pmrpostswidget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wp-postsmostread-option
    • > Deprecated in wp-content/plugins/wp-posts-most-read/PMRposts.php+586
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=wp-postsmostread-option
    • > Notice in wp-content/plugins/wp-posts-most-read/PMRposts.php+528
    Undefined variable: control_ops
    • > GET request to /wp-admin/options-general.php?page=wp-postsmostread-option
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in PMRpostsWidget is deprecated since version 4.3.0! Use __construct() instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-postsmostread-option
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=wp-postsmostread-option
    • > User notice in wp-includes/functions.php+5663
    wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
    • > GET request to /wp-admin/options-general.php?page=wp-postsmostread-option
    • > Notice in wp-includes/wp-db.php+1323
    Undefined offset: 0
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-postsmostread-option
    • > User deprecated in wp-includes/functions.php+5495
    get_bloginfo was called with an argument that is deprecated since version 2.2.0! The siteurl option is deprecated for the family of bloginfo() functions. Use the url option instead.

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-posts-most-read/PMRposts.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-posts-most-read/inc/PMRlisting.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-posts-most-read/inc/PMRoptions.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_reset_query() in wp-content/plugins/wp-posts-most-read/inc/PMRdisplay_admin.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_reset_query() in wp-content/plugins/wp-posts-most-read/inc/PMRdisplay.php:1

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

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === Name: WP Posts Most Read === )
The official readme.txt is a good inspiration

wp-posts-most-read/PMRposts.php 92% from 13 tests

The main PHP file in "Name: WP Posts Most Read " ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-posts-most-read.php" instead of "PMRposts.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
Everything looks great! No dangerous files found in this plugin1,285 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP551230579
PO File3260479498
CSS250198
JavaScript17010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity24.00
▷ Minimum class complexity9.00
▷ Maximum class complexity39.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/icon-google-plus.png1.66KB1.52KB▼ 8.02%