77% download-counter-button

Code Review | MelAbu WP Download Counter Button

WordPress plugin MelAbu WP Download Counter Button scored 77% from 54 tests.

About plugin

  • Plugin page: download-counter-...
  • Plugin version: 1.8.6.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.1.1
  • WordPress version: 6.3.1
  • First release: Feb 19, 2016
  • Latest release: May 7, 2019
  • Number of updates: 506
  • Update frequency: every 2.3 days
  • Top authors: ProDeveloper (95.45%)alexpeschel (4.74%)

Code review

54 tests

User reviews

5 reviews

Install metrics

70+ active / 8,912 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.53MB] [CPU: ▲9.13ms] Passed 4 tests

Server-side resources used by MelAbu WP Download Counter Button
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3946.79 ▲7.34
Dashboard /wp-admin3.93 ▲0.6253.19 ▲3.71
Posts /wp-admin/edit.php3.98 ▲0.6258.00 ▲13.85
Add New Post /wp-admin/post-new.php6.46 ▲0.57107.94 ▲15.44
Media Library /wp-admin/upload.php3.78 ▲0.5650.05 ▲11.62
About /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-73.8544.43
Design /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-13.7944.21
Settings /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-53.8142.38
Subscribes /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-33.7545.54
Modal /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-23.7743.10
Downloads /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-43.7543.54
MB DCB /wp-admin/admin.php?page=melibu-plugin-download-admin3.8440.95
Shortcode /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-63.8043.50

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 183 new files
Database: 2 new tables, 9 new options
New tables
wp_melibu_dcb
wp_melibu_dcb_sub
New WordPress options
can_compress_scripts
widget_download-counter-button
db_upgraded
melibuPlugin_DCB_db_version
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
melibuPlugin_DCB_version

Browser metrics Passed 4 tests

A check of browser resources used by MelAbu WP Download Counter Button
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,020 ▲28513.18 ▼1.402.65 ▲0.8247.08 ▲6.26
Dashboard /wp-admin2,256 ▲655.93 ▲0.0395.15 ▼5.8681.57 ▲34.69
Posts /wp-admin/edit.php2,205 ▲1162.01 ▲0.0239.38 ▲3.7138.53 ▲6.42
Add New Post /wp-admin/post-new.php1,732 ▲21824.63 ▲6.93643.00 ▼45.1434.58 ▼26.61
Media Library /wp-admin/upload.php1,444 ▲564.24 ▼0.0895.60 ▼13.6987.38 ▲40.13
About /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-71,9202.2328.8875.83
Design /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-11,4592.0826.9347.20
Settings /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-51,4751.7425.0446.10
Subscribes /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-38822.0926.0631.17
Modal /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-21,0652.3526.0542.75
Downloads /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-48802.2226.9329.85
MB DCB /wp-admin/admin.php?page=melibu-plugin-download-admin1,3552.2226.5575.94
Shortcode /wp-admin/admin.php?page=melibu-plugin-download-admin-control-menu-61,1112.2026.0540.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_download-counter-button

Smoke tests 50% from 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/download-counter-button/tpl/tpl.audio.php
    • > /wp-content/plugins/download-counter-button/functions/count/download.php
  • 25× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/download-counter-button/tpl/modal.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/download-counter-button/html/dummy/dummy.php:12
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/download-counter-button/html/download/font.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/download-counter-button/html/download/modal_option_form.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/download-counter-button/html/download/captcha.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/download-counter-button/html/download/hidecount.php:12
    • > PHP Notice
      Undefined variable: melibu_plugin_dcb_modal in wp-content/plugins/download-counter-button/tpl/modal.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/download-counter-button/tpl/modal.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/download-counter-button/html/download/label_option_form.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/download-counter-button/html/download/button_icon_color_form.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (A small overview), #2 (Single), #3 (Single and Single), #4 (Duplicate and Single), #5 (Hide Counts for Users), #6 (You can adjust the settings easily so it fits your needs), #7 (Custom Title and Description for your Users), #8 (Check in the Subscription your subscribers), #9 (Check in the Overview your downloads), #10 (All Custom Settings), #11 (Place the Shortcode on any page or post), #12 (Place the Shortcode on MelAbu WP Download Counter Button Widget widget or in any text widget), #13 (To see your Top 5 downloads), #14 (Any document/file Type,this downloader open the right window (here image PNG)), #15 (Or here with MP3 file), #16 (And another file with PDF file type), #17 (Say Thank You! The Thanks Window shows a Modal with your custom text after clicking the download button), #18 (Activate MelAbu Subscription for Download), #19 (Activate MelAbu Subscription with Name for Download), #20 (Activate MelAbu Captcha for Download), #21 (Activate MelAbu Subscription and MelAbu Captcha for Download), #22 (Activate MelAbu Subscription with Name and MelAbu Captcha for Download), #23 (Check fields)
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

download-counter-button/download-counter-button.php 92% from 13 tests

"MelAbu WP Download Counter Button" version 1.8.6.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 371 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin16,240 lines of code in 94 files:
LanguageFilesBlank linesComment linesLines of code
PO File253,5954,3637,356
PHP435821,0684,610
LESS151,1631202,839
JavaScript680122746
SVG100685
CSS4034

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity32.62
▷ Minimum class complexity4.00
▷ Maximum class complexity60.00
Average method complexity4.81
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes215.38%
▷ Concrete classes1184.62%
▷ Final classes00.00%
Methods108
▷ Static methods54.63%
▷ Public methods8477.78%
▷ Protected methods1312.04%
▷ Private methods1110.19%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants981.82%
▷ Class constants218.18%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
48 PNG files occupy 5.52MB with 3.69MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/forbidden.png34.51KB13.29KB▼ 61.49%
img/downloadlabel.png55.37KB18.26KB▼ 67.02%
screenshot-16.png137.49KB44.02KB▼ 67.98%
img/downloaddatetime.png60.72KB19.78KB▼ 67.42%
screenshot-6.png162.34KB48.00KB▼ 70.43%