74% display-popular-post

Code Review | Display Popular Post

WordPress plugin Display Popular Post scored 74% from 54 tests.

About plugin

  • Plugin page: display-popular-post
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.2.3
  • WordPress version: 6.3.1
  • First release: Sep 24, 2019
  • Latest release: Sep 24, 2019
  • Number of updates: 3
  • Update frequency: every 2.7 days
  • Top authors: hmbashar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 558 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.78MB] [CPU: ▼49.62ms] Passed 4 tests

Server-side resources used by Display Popular Post
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.19 ▼1.2810.11 ▼32.66
Dashboard /wp-admin2.24 ▼1.0710.19 ▼40.65
Posts /wp-admin/edit.php2.24 ▼1.1211.05 ▼40.90
Add New Post /wp-admin/post-new.php2.24 ▼3.6510.51 ▼84.25
Media Library /wp-admin/upload.php2.24 ▼0.9910.19 ▼24.91

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Display Popular Post
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.34 ▼1.032.60 ▲0.6153.03 ▲10.72
Dashboard /wp-admin2,208 ▲294.87 ▼1.01109.54 ▲4.9939.15 ▼8.94
Posts /wp-admin/edit.php2,091 ▲22.00 ▼0.0539.29 ▼2.1635.58 ▼2.07
Add New Post /wp-admin/post-new.php1,408 ▼10617.97 ▲0.34612.11 ▼76.0261.29 ▲2.29
Media Library /wp-admin/upload.php1,390 ▲24.20 ▼0.0799.97 ▼3.8242.60 ▼0.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the cb-display-popular-post-css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/display-popular-post/cb-dpp.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: shortcode, display post, hot post, popular post

display-popular-post/cb-dpp.php 92% from 13 tests

This is the main PHP file of "Display Popular Post" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("display-popular-post.php" instead of "cb-dpp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin81 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2281248
CSS11233

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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 are no PNG files in this plugin