84% edd-metrics

Code Review | EDD Metrics

WordPress plugin EDD Metrics scored84%from 54 tests.

About plugin

  • Plugin page: edd-metrics
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Sep 26, 2016
  • Latest release: Nov 17, 2018
  • Number of updates: 8
  • Update frequency: every 99.3 days
  • Top authors: scottopolis (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

100+ active /3,761 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.57ms] Passed 4 tests

Analyzing server-side resources used by EDD Metrics
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.18 ▼6.87
Dashboard /wp-admin3.31 ▲0.0145.01 ▼3.66
Posts /wp-admin/edit.php3.37 ▲0.0148.67 ▲0.83
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.00 ▼11.98
Media Library /wp-admin/upload.php3.24 ▲0.0133.83 ▲0.23

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for EDD Metrics
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲6114.47 ▲0.171.83 ▼0.3044.28 ▲5.82
Dashboard /wp-admin2,213 ▲225.83 ▲0.97104.47 ▲4.2736.55 ▼7.24
Posts /wp-admin/edit.php2,095 ▲31.97 ▼0.0637.51 ▼5.2336.67 ▼0.72
Add New Post /wp-admin/post-new.php1,542 ▲923.32 ▲0.06673.09 ▲77.0854.86 ▲5.80
Media Library /wp-admin/upload.php1,398 ▲104.28 ▲0.0294.47 ▼5.3441.86 ▼3.88

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/edd-metrics/includes/view-metrics-details.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/edd-metrics/includes/view-dashboard.php:3

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

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: Screenshot #2 (Revenue details) image required
Please take inspiration from this readme.txt

edd-metrics/edd-metrics.php Passed 13 tests

"EDD Metrics" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
94 characters long description:
All the stats, analytics, and metrics you need when selling stuff with Easy Digital Downloads.

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
There were no executable files found in this plugin2,268 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript527248955
PHP7392503852
CSS3934428
Markdown118033

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity16.00
▷ Minimum class complexity4.00
▷ Maximum class complexity48.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods48
▷ Static methods3777.08%
▷ Public methods4491.67%
▷ Protected methods00.00%
▷ Private methods48.33%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
2 PNG files occupy 1.13MB with 0.70MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png1,143.54KB297.20KB▼ 74.01%
assets/img/chart1.png11.86KB6.02KB▼ 49.29%