90% edd-protect-images

Code Review | Easy Digital Downloads - Protect Images

WordPress plugin Easy Digital Downloads - Protect Images scored 90% from 54 tests.

About plugin

  • Plugin page: edd-protect-images
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.4
  • WordPress version: 6.3.1
  • First release: Jul 10, 2017
  • Latest release: Jul 10, 2017
  • Number of updates: 9
  • Update frequency: every 9.4 days
  • Top authors: wooninjas (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 695 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 gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.30ms] Passed 4 tests

An overview of server-side resources used by Easy Digital Downloads - Protect Images
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.84 ▼0.28
Dashboard /wp-admin3.32 ▲0.0245.99 ▼6.14
Posts /wp-admin/edit.php3.37 ▲0.0246.49 ▼2.34
Add New Post /wp-admin/post-new.php5.90 ▲0.0286.19 ▼12.44
Media Library /wp-admin/upload.php3.24 ▲0.0139.23 ▲4.45

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Easy Digital Downloads - Protect Images: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.65 ▼0.001.61 ▲0.0340.50 ▼2.45
Dashboard /wp-admin2,206 ▲155.85 ▲0.97106.28 ▼0.6937.31 ▼9.55
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0537.80 ▲0.7633.70 ▲0.85
Add New Post /wp-admin/post-new.php1,533 ▲1323.31 ▲0.07618.67 ▼31.0052.18 ▼8.85
Media Library /wp-admin/upload.php1,379 ▼64.24 ▼0.15102.24 ▼1.3842.15 ▼2.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

edd-protect-images/edd-protect-images.php Passed 13 tests

The main file in "Easy Digital Downloads - Protect Images" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
64 characters long description:
Protects (compress) image files when uploaded as file attachment

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin389 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP5108112292
JavaScript1311297

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity12.25
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods22
▷ Static methods14.55%
▷ Public methods1881.82%
▷ Protected methods14.55%
▷ Private methods313.64%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected