10% eea-promotions-restrict-to-email

Code Review | Promotions Restrict to Email for Event Espresso

WordPress plugin Promotions Restrict to Email for Event Espresso scored10%from 54 tests.

About plugin

  • Plugin page: eea-promotions-re...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.1.1
  • WordPress version: 6.3.1
  • First release: Aug 2, 2022
  • Latest release: Jan 12, 2023
  • Number of updates: 4
  • Update frequency: every 41.0 days
  • Top authors: marries (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /365 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/eea-promotions-restrict-to-email/eea-promotions-restrict-to-email.php+47
    Use of undefined constant EVENT_ESPRESSO_UPLOAD_DIR - assumed 'EVENT_ESPRESSO_UPLOAD_DIR' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▲0.00MB] [CPU: ▼10.04ms] Passed 4 tests

Analyzing server-side resources used by Promotions Restrict to Email for Event Espresso
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.13 ▼4.14
Dashboard /wp-admin3.31 ▲0.0051.22 ▼2.43
Posts /wp-admin/edit.php3.36 ▲0.0040.70 ▼9.36
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.55 ▼21.49
Media Library /wp-admin/upload.php3.23 ▲0.0033.01 ▼5.15

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Promotions Restrict to Email for Event Espresso
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.17 ▼0.381.85 ▲0.2447.21 ▲9.22
Dashboard /wp-admin2,195 ▲155.63 ▼0.0487.40 ▼5.2636.33 ▼3.36
Posts /wp-admin/edit.php2,100 ▲32.03 ▲0.0035.18 ▼2.3934.05 ▼1.82
Add New Post /wp-admin/post-new.php1,526 ▼023.16 ▲0.13694.33 ▲24.7651.98 ▲3.07
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.04102.69 ▼11.6245.46 ▼3.24

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 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
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/eea-promotions-restrict-to-email/EED_Promotions_Restrict_to_Email.module.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/eea-promotions-restrict-to-email/eea-promotions-restrict-to-email.php:52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/eea-promotions-restrict-to-email/templates/promotion_restrict_to_email_form.template.php:24

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

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: promotions, event espresso

eea-promotions-restrict-to-email/eea-promotions-restrict-to-email.php Passed 13 tests

The entry point to "Promotions Restrict to Email for Event Espresso" version 1.0.1 is a PHP file that has certain tags in its header comment area
86 characters long description:
Allows the Event Espresso Promotions Addon to be limited to specific e-mail addresses.

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
There were no executable files found in this plugin248 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP460179248

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.50
▷ Minimum class complexity5.00
▷ Maximum class complexity10.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods969.23%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin