90% simple-download-counter

Code Review | Simple Download Counter

WordPress plugin Simple Download Counter scored90%from 54 tests.

About plugin

  • Plugin page: simple-download-c...
  • Plugin version: 1.7
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Sep 19, 2022
  • Latest release: Oct 26, 2023
  • Number of updates: 12
  • Update frequency: every 33.4 days
  • Top authors: specialk (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

700+ active /4,462 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.41MB] [CPU: ▲0.15ms] Passed 4 tests

A check of server-side resources used by Simple Download Counter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3542.49 ▲3.13
Dashboard /wp-admin3.77 ▲0.4753.92 ▲6.23
Posts /wp-admin/edit.php3.82 ▲0.4749.04 ▼2.41
Add New Post /wp-admin/post-new.php6.32 ▲0.4385.67 ▼6.33
Media Library /wp-admin/upload.php3.63 ▲0.4042.71 ▲8.49
Add New /wp-admin/post-new.php?post_type=sdc_download3.8860.28
Tags /wp-admin/edit-tags.php?taxonomy=sdc_download_tag&post_type=sdc_download3.7540.02
Settings /wp-admin/edit.php?post_type=sdc_download&page=download-counter-settings3.6539.66
All Downloads /wp-admin/edit.php?post_type=sdc_download3.7747.90
Categories /wp-admin/edit-tags.php?taxonomy=sdc_download_category&post_type=sdc_download3.7640.68

Server storage [IO: ▲0.11MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
sdc_download_category_children
default_term_sdc_download_category
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Simple Download Counter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6414.18 ▼0.372.06 ▲0.4843.45 ▲0.87
Dashboard /wp-admin2,231 ▲515.56 ▼0.1086.31 ▲2.7037.62 ▲1.08
Posts /wp-admin/edit.php2,133 ▲362.41 ▲0.3945.12 ▲8.8133.78 ▲0.68
Add New Post /wp-admin/post-new.php1,561 ▲3523.37 ▲0.24675.90 ▼38.4940.70 ▼22.61
Media Library /wp-admin/upload.php1,436 ▲364.28 ▲0.11105.05 ▲6.0445.26 ▲1.60
Add New /wp-admin/post-new.php?post_type=sdc_download2,1364.2384.6640.33
Tags /wp-admin/edit-tags.php?taxonomy=sdc_download_tag&post_type=sdc_download1,2792.1226.3427.21
Settings /wp-admin/edit.php?post_type=sdc_download&page=download-counter-settings8922.0637.9234.00
All Downloads /wp-admin/edit.php?post_type=sdc_download1,1752.3035.9329.61
Categories /wp-admin/edit-tags.php?taxonomy=sdc_download_category&post_type=sdc_download1,4062.1227.4931.83

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • sdc_download_category_children
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • default_term_sdc_download_category

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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 | This is a shallow check for browser errors
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
5 plugin tags: file manager, download manager, download counter, download, downloads

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

The main PHP file in "Simple Download Counter" ver. 1.7 adds more information about the plugin and also serves as the entry point for this plugin
91 characters long description:
Counts the number of downloads for any file type. Display download counts using shortcodes.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin1,492 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP121,069791,299
JavaScript2386113
CSS130580

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions86
▷ Named functions86100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/download-bg.png1.47KB1.63KB0.00%
img/download.png0.82KB0.90KB0.00%