10% display-post-number

Code Review | Display Post Number

WordPress plugin Display Post Number scored10%from 54 tests.

About plugin

  • Plugin page: display-post-number
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.1
  • WordPress version: 6.3.1
  • First release: Jun 1, 2013
  • Latest release: Jun 1, 2013
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: hopstep (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /861 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/display-post-number/display_post_number.php+56
    Use of undefined constant no - assumed 'no' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼0.16MB] [CPU: ▼8.90ms] Passed 4 tests

Server-side resources used by Display Post Number
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.79 ▼0.6718.09 ▼23.62
Dashboard /wp-admin3.32 ▲0.0149.75 ▼3.95
Posts /wp-admin/edit.php3.37 ▲0.0149.43 ▲1.87
Add New Post /wp-admin/post-new.php5.90 ▲0.0288.47 ▼7.96
Media Library /wp-admin/upload.php3.25 ▲0.0239.89 ▼0.05

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 10 new options
New WordPress options
dn_posts_tag
widget_recent-posts
db_upgraded
widget_recent-comments
dn_posts_category
dn_posts_search
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
dn_posts_archive

Browser metrics Passed 4 tests

An overview of browser requirements for Display Post Number
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7914.40 ▲0.112.73 ▲0.9344.14 ▼3.31
Dashboard /wp-admin2,209 ▲215.84 ▼0.0494.94 ▼20.6936.35 ▼9.61
Posts /wp-admin/edit.php2,092 ▲32.00 ▼0.0037.27 ▲0.1432.66 ▼1.21
Add New Post /wp-admin/post-new.php1,535 ▲2122.82 ▲5.24633.81 ▼26.9057.17 ▼3.33
Media Library /wp-admin/upload.php1,385 ▼04.29 ▲0.1598.14 ▼6.5743.44 ▼5.93

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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 take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/display-post-number/display_post_number.php:52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/display-post-number/display_post_number.php:52

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Donate link: Please fix this invalid url: ""
You can take inspiration from this readme.txt

display-post-number/display_post_number.php 92% from 13 tests

"Display Post Number" version 0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("display-post-number.php" instead of "display_post_number.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin130 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22821130

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
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%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin