10% edd-discounts-by-time

Code Review | Edd Discounts By Time

WordPress plugin Edd Discounts By Time scored10%from 54 tests.

About plugin

  • Plugin page: edd-discounts-by-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0.1
  • WordPress version: 6.3.1
  • First release: Dec 18, 2014
  • Latest release: Dec 18, 2014
  • Number of updates: 10
  • Update frequency: every 78.5 days
  • Top authors: debjyati_dc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,039 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/edd-discounts-by-time/edd_discounts_by_time.php+13
    Non-static method EDD_Dependencies::edd_active_check() should not be called statically

Server metrics [RAM: ▼1.96MB] [CPU: ▼53.88ms] Passed 4 tests

A check of server-side resources used by Edd Discounts By Time
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.39 ▼37.30
Dashboard /wp-admin2.05 ▼1.265.21 ▼46.61
Posts /wp-admin/edit.php2.05 ▼1.315.02 ▼45.03
Add New Post /wp-admin/post-new.php2.05 ▼3.845.99 ▼86.59
Media Library /wp-admin/upload.php2.05 ▼1.185.27 ▼29.12

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

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

Browser metrics Passed 4 tests

Edd Discounts By Time: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲4114.40 ▲0.051.90 ▲0.2643.80 ▼3.07
Dashboard /wp-admin2,208 ▲315.61 ▲0.0490.75 ▼2.1940.49 ▼2.19
Posts /wp-admin/edit.php2,114 ▲142.03 ▲0.0636.27 ▼1.6736.34 ▲3.48
Add New Post /wp-admin/post-new.php1,539 ▲1123.42 ▲0.49599.16 ▲9.9746.25 ▼9.65
Media Library /wp-admin/upload.php1,410 ▲164.24 ▲0.0598.09 ▼3.1144.31 ▼0.27

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/edd-discounts-by-time/edd_discounts_by_time.php+13
    Non-static method EDD_Dependencies::edd_active_check() should not be called statically
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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 fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/edd-discounts-by-time/includes/class-dc-dependencies.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
7 plugin tags: easy digital downloads discount, discount, edd discount, edd add-on, easy digital downloads...

edd-discounts-by-time/edd_discounts_by_time.php 92% from 13 tests

The primary PHP file in "Edd Discounts By Time" version 1.0.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("edd-discounts-by-time.php" instead of "edd_discounts_by_time.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin522 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP86256330
CSS2180101
PO File1303176
JavaScript21515

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity4.80
▷ Minimum class complexity2.00
▷ Maximum class complexity8.00
Average method complexity1.73
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
7 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/dclogo.png3.46KB0.84KB▼ 75.80%
(invalid) assets/images/question_mark.png0.86KB0.00KB▼ 100.00%
assets/images/fpd/grid.png2.69KB0.13KB▼ 95.17%
assets/images/placeholder.png2.75KB2.92KB0.00%
assets/images/dualcube.png3.29KB0.65KB▼ 80.17%