84% universal-post-counter

Code Review | Universal Post Counter

WordPress plugin Universal Post Counter scored84%from 54 tests.

About plugin

  • Plugin page: universal-post-co...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: May 3, 2021
  • Latest release: Aug 10, 2023
  • Number of updates: 12
  • Update frequency: every 69.5 days
  • Top authors: PressTigers (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /960 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼2.73ms] Passed 4 tests

A check of server-side resources used by Universal Post Counter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0240.92 ▼3.15
Dashboard /wp-admin3.41 ▲0.0648.90 ▼5.36
Posts /wp-admin/edit.php3.52 ▲0.1251.59 ▲1.96
Add New Post /wp-admin/post-new.php6.00 ▲0.0896.79 ▼4.11
Media Library /wp-admin/upload.php3.33 ▲0.0638.56 ▲1.69

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Universal Post Counter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,869 ▲10814.36 ▲0.241.61 ▼0.2729.47 ▼13.62
Dashboard /wp-admin2,275 ▲955.64 ▼0.0783.84 ▼6.8845.01 ▲0.31
Posts /wp-admin/edit.php2,107 ▲72.01 ▲0.0638.88 ▲0.4537.18 ▼1.88
Add New Post /wp-admin/post-new.php1,530 ▲223.77 ▲0.77603.97 ▼64.1556.98 ▼2.93
Media Library /wp-admin/upload.php1,407 ▲44.16 ▲0.0199.23 ▼2.0745.62 ▲0.05

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/universal-post-counter/public/partials/universal-post-counter-public-display.php

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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Donate link: Please fix this invalid url: "www.presstigers.com"
You can take inspiration from this readme.txt

universal-post-counter/universal-post-counter.php Passed 13 tests

The main file in "Universal Post Counter" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
92 characters long description:
Universal Post Counter allows the admin to see post count for default and custom post types.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected282 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP11113510224
CSS23755
JavaScript12273

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.27
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods26
▷ Static methods27.69%
▷ Public methods2180.77%
▷ Protected methods00.00%
▷ Private methods519.23%
Functions4
▷ Named functions4100.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
No PNG files were detected