63% cybrosys-post-counter

Code Review | Post Counter

WordPress plugin Post Counter scored63%from 54 tests.

About plugin

  • Plugin page: cybrosys-post-cou...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0.3
  • WordPress version: 6.3.1
  • First release: Nov 8, 2022
  • Latest release: Nov 8, 2022
  • Number of updates: 4
  • Update frequency: every 3.0 days
  • Top authors: cybrosys (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /154 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼0.26MB] [CPU: ▼16.39ms] Passed 4 tests

Analyzing server-side resources used by Post Counter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.67 ▼4.04
Dashboard /wp-admin3.39 ▲0.0849.39 ▲1.58
Posts /wp-admin/edit.php3.50 ▲0.1444.85 ▼0.52
Add New Post /wp-admin/post-new.php4.68 ▼1.2142.88 ▼58.90
Media Library /wp-admin/upload.php3.31 ▲0.0832.21 ▼2.10
Post Counter /wp-admin/options-general.php?page=post-counter3.2838.28

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Post Counter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.71 ▼0.691.71 ▼0.2142.74 ▼0.62
Dashboard /wp-admin2,213 ▲274.84 ▼0.10108.34 ▼15.6843.87 ▼3.23
Posts /wp-admin/edit.php2,123 ▲342.01 ▲0.0138.13 ▲0.9130.94 ▼0.87
Add New Post /wp-admin/post-new.php1,536 ▲1723.32 ▼0.06667.35 ▲16.3151.06 ▼5.03
Media Library /wp-admin/upload.php1,392 ▲74.28 ▲0.1496.22 ▲1.3942.23 ▼0.09
Post Counter /wp-admin/options-general.php?page=post-counter8452.0423.6427.30

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Compile error in wp-content/plugins/cybrosys-post-counter/post-check.php+3
    Cannot redeclare cpcp_post_view_check_field() (previously declared in wp-content/plugins/cybrosys-post-counter/post-check.php:3)
  • The plugin did not uninstall correctly, leaving 10 files (0.92MB) in the plugin directory
    • (new file) assets/Screenshot 2022-10-12 160044.png
    • (new file) uninstall.php
    • (new file) css/cpcp-style.css
    • (new file) readme.txt
    • (new file) post-check.php
    • (new file) index.php
    • (new file) assets/Screenshot 2022-10-12 155816.png
    • (new file) post-view.php
    • (new file) assets/Screenshot 2022-10-12 155904.png
    • (new file) assets/Screenshot 2022-10-12 155641.png
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means 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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/cybrosys-post-counter/post-view.php:18

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Settings page of the plugin /assets/Screenshot 2022-10-12 160044.png), #2 (Settings saved page of the plugin /assets/Screenshot 2022-10-12 155816.png), #3 (Count shown before the content /assets/Screenshot 2022-10-12 155904.png), #4 (Count shown after the content /assets/Screenshot 2022-10-12 155641.png)
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
You can take inspiration from this readme.txt

cybrosys-post-counter/post-view.php 92% from 13 tests

The main PHP file in "Post Counter" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("cybrosys-post-counter.php" instead of "post-view.php")

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
Success! There were no dangerous files found in this plugin246 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP43950229
CSS13017

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.90MB with 0.58MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/Screenshot 2022-10-12 155904.png62.86KB25.09KB▼ 60.08%
assets/Screenshot 2022-10-12 155641.png742.05KB190.39KB▼ 74.34%
assets/Screenshot 2022-10-12 160044.png57.32KB21.72KB▼ 62.12%
assets/Screenshot 2022-10-12 155816.png63.50KB24.18KB▼ 61.92%