84% posts-number-widget

Code Review | Posts Number Widget

WordPress plugin Posts Number Widget scored84%from 54 tests.

About plugin

  • Plugin page: posts-number-widget
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2.2
  • WordPress version: 6.3.1
  • First release: Nov 12, 2013
  • Latest release: Jun 24, 2019
  • Number of updates: 12
  • Update frequency: every 170.9 days
  • Top authors: sysbird (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,281 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.32ms] Passed 4 tests

A check of server-side resources used by Posts Number Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.18 ▼1.20
Dashboard /wp-admin3.31 ▲0.0142.56 ▼6.39
Posts /wp-admin/edit.php3.37 ▲0.0145.61 ▼6.71
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.99 ▼6.99
Media Library /wp-admin/upload.php3.24 ▲0.0134.57 ▲0.60

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Posts Number Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.26 ▼1.391.77 ▼0.0241.90 ▼0.82
Dashboard /wp-admin2,206 ▲155.91 ▲1.02108.97 ▼5.2238.28 ▼8.24
Posts /wp-admin/edit.php2,089 ▲32.05 ▲0.0438.90 ▼0.0535.57 ▼1.05
Add New Post /wp-admin/post-new.php1,542 ▼018.46 ▲0.03593.08 ▼8.1964.41 ▲7.88
Media Library /wp-admin/upload.php1,388 ▼04.22 ▲0.0097.57 ▼11.3846.06 ▼0.94

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_posts_number_widget
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/posts-number-widget/posts-number-widget.php:13

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Posts Number Widget management page on Widget.), #2 (Display Widget at sidebar.), #3 (Posts Number Widget management page on Widget (for Japanese).), #4 (Display Widget at sidebar (for Japanese).)
Please take inspiration from this readme.txt

posts-number-widget/posts-number-widget.php Passed 13 tests

The main PHP file in "Posts Number Widget" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
35 characters long description:
The widget display number of posts.

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
No dangerous file extensions were detected40 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP191040

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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 were not PNG files found in your plugin