10% post-counter

Code Review | Post-counter

WordPress plugin Post-counter scored10%from 54 tests.

About plugin

  • Plugin page: post-counter
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.1.1
  • WordPress version: 6.3.1
  • First release: Nov 25, 2014
  • Latest release: Mar 23, 2015
  • Number of updates: 3
  • Update frequency: every 40.3 days
  • Top authors: tomek00 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,209 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/post-counter/posts.php+19
    Methods with the same name as their class will not be constructors in a future version of PHP; WP_Widget_Post_Count has a deprecated constructor

Server metrics [RAM: ▼1.72MB] [CPU: ▼47.82ms] Passed 4 tests

This is a short check of server-side resources used by Post-counter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.189.04 ▼28.44
Dashboard /wp-admin2.30 ▼1.0412.41 ▼46.07
Posts /wp-admin/edit.php2.30 ▼1.0510.52 ▼33.98
Add New Post /wp-admin/post-new.php2.30 ▼3.5810.96 ▼82.78
Media Library /wp-admin/upload.php2.30 ▼0.938.27 ▼23.88

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_post-count-widget
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Post-counter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.34 ▼0.051.67 ▲0.1543.02 ▲3.17
Dashboard /wp-admin2,198 ▲235.68 ▲0.0191.18 ▼10.2842.77 ▲5.87
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0839.28 ▲5.3034.79 ▼4.01
Add New Post /wp-admin/post-new.php1,540 ▲1218.07 ▼5.14619.83 ▼42.1762.94 ▲0.46
Media Library /wp-admin/upload.php1,400 ▼34.23 ▲0.0697.69 ▼2.3443.58 ▼0.05

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in WP_Widget_Post_Count is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_post-count-widget

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× 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/post-counter/posts.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: post, count, counter, posts, widget

post-counter/posts.php 92% from 13 tests

This is the main PHP file of "Post-counter" version 0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("post-counter.php" instead of "posts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin60 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP18838
PO File13422

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.05
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.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 functions1100.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 were not PNG files found in your plugin