90% simple-product-counter

Code Review | Simple product counter

WordPress plugin Simple product counter scored90%from 54 tests.

About plugin

  • Plugin page: simple-product-co...
  • Plugin version: 2.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Feb 21, 2020
  • Latest release: Jun 15, 2021
  • Number of updates: 23
  • Update frequency: every 20.9 days
  • Top authors: webarea (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

80+ active /1,358 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Server-side resources used by Simple product counter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.58 ▼1.34
Dashboard /wp-admin3.31 ▲0.0043.52 ▼6.81
Posts /wp-admin/edit.php3.36 ▲0.0046.96 ▼0.65
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.08 ▲0.93
Media Library /wp-admin/upload.php3.23 ▲0.0034.98 ▼2.13

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Simple product counter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲9113.21 ▼1.041.91 ▲0.1539.76 ▼3.23
Dashboard /wp-admin2,215 ▲275.85 ▲0.75106.91 ▼8.4538.01 ▼7.79
Posts /wp-admin/edit.php2,104 ▲152.05 ▲0.0535.98 ▲0.0135.86 ▼4.39
Add New Post /wp-admin/post-new.php1,545 ▲322.97 ▼0.26646.37 ▼16.2958.27 ▼0.72
Media Library /wp-admin/upload.php1,400 ▲94.25 ▼0.0194.23 ▼3.5242.82 ▼6.62

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: notice, product, count, post views, woocommerce...

simple-product-counter/simple-product-counter.php Passed 13 tests

Analyzing the main PHP file in "Simple product counter" version 2.2.0
55 characters long description:
Notice with product sales and views for certain period.

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
Everything looks great! No dangerous files found in this plugin1,512 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP310435721
CSS377527
JavaScript1214141
SVG6303123

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity43.00
▷ Minimum class complexity4.00
▷ Maximum class complexity63.00
Average method complexity4.94
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods32
▷ Static methods00.00%
▷ Public methods2475.00%
▷ Protected methods00.00%
▷ Private methods825.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/logo.png31.68KB10.80KB▼ 65.91%