10% opt-in-hound

Code Review | Easy WordPress Subscribe - Optin Hound

WordPress plugin Easy WordPress Subscribe - Optin Hound scored10%from 54 tests.

About plugin

  • Plugin page: opt-in-hound
  • Plugin version: 1.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-4.9.5
  • WordPress version: 6.3.1
  • First release: Apr 29, 2017
  • Latest release: Apr 27, 2018
  • Number of updates: 56
  • Update frequency: every 6.5 days
  • Top authors: iova.mihai (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /24,699 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/opt-in-hound/includes/functions-admin-settings-fields.php+644
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.12MB] [CPU: ▼44.64ms] Passed 4 tests

A check of server-side resources used by Easy WordPress Subscribe - Optin Hound
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▼0.609.50 ▼29.16
Dashboard /wp-admin2.88 ▼0.429.96 ▼37.15
Posts /wp-admin/edit.php2.88 ▼0.4712.00 ▼36.74
Add New Post /wp-admin/post-new.php2.88 ▼3.0010.83 ▼75.51
Media Library /wp-admin/upload.php2.88 ▼0.3410.03 ▼23.45
Settings /wp-admin/admin.php?page=oih-settings2.8811.01
Opt-in Forms /wp-admin/admin.php?page=oih-opt-in-forms2.8811.81
Extensions /wp-admin/admin.php?page=oih-extensions2.8810.19
Subscriber Lists /wp-admin/admin.php?page=oih-lists2.8810.29
Uninstall /wp-admin/admin.php?page=oih-uninstall2.8811.63

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 136 new files
Database: 3 new tables, 12 new options
New tables
wp_oih_lists
wp_oih_opt_ins
wp_oih_subscribers
New WordPress options
can_compress_scripts
oih_first_activation
widget_theysaidso_widget
oih_version
widget_oih_opt_in_widget
widget_recent-posts
widget_recent-comments
db_upgraded
oih_version_compatibility_v_1_2_0
theysaidso_admin_options
...

Browser metrics Passed 4 tests

A check of browser resources used by Easy WordPress Subscribe - Optin Hound
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,022 ▲27614.38 ▲0.017.64 ▲5.8120.15 ▼23.29
Dashboard /wp-admin2,317 ▲1295.36 ▲0.42110.17 ▼0.7655.36 ▲9.18
Posts /wp-admin/edit.php2,181 ▲922.53 ▲0.5242.39 ▲1.8646.48 ▲7.02
Add New Post /wp-admin/post-new.php1,611 ▲7823.51 ▲0.17628.42 ▼55.9038.99 ▼19.15
Media Library /wp-admin/upload.php1,501 ▲1134.57 ▲0.3793.79 ▼14.9554.72 ▲13.21
Settings /wp-admin/admin.php?page=oih-settings1,8817.29157.95119.20
Opt-in Forms /wp-admin/admin.php?page=oih-opt-in-forms1,2203.5948.88104.60
Extensions /wp-admin/admin.php?page=oih-extensions1,1742.2030.6175.50
Subscriber Lists /wp-admin/admin.php?page=oih-lists1,1782.3528.7746.26
Uninstall /wp-admin/admin.php?page=oih-uninstall1,0572.2430.0844.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/opt-in-hound/includes/functions-admin-settings-fields.php+644
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • Zombie tables detected upon uninstall: 3 tables
    • wp_oih_lists
    • wp_oih_opt_ins
    • wp_oih_subscribers
  • This plugin does not fully uninstall, leaving 12 options in the database
    • theysaidso_admin_options
    • oih_version_compatibility_v_1_4_0
    • oih_version_type
    • widget_recent-comments
    • widget_oih_opt_in_widget
    • widget_recent-posts
    • oih_version_compatibility_v_1_2_0
    • widget_theysaidso_widget
    • db_upgraded
    • oih_first_activation
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=oih-uninstall
    • > Deprecated in wp-content/plugins/opt-in-hound/includes/functions-admin-settings-fields.php+644
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

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
The following issues need your attention
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/opt-in-hound/includes/extensions-promo/views/view-promo-pop-up-opt-in-types.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/opt-in-hound/includes/modules/deactivate/views/view-modal-deactivate.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/opt-in-hound/includes/extensions-promo/functions.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
You can take inspiration from this readme.txt

opt-in-hound/index.php 92% from 13 tests

The main PHP file in "Easy WordPress Subscribe - Optin Hound" ver. 1.4.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("opt-in-hound.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin14,278 lines of code in 104 files:
LanguageFilesBlank linesComment linesLines of code
PHP793,2723,3236,610
JavaScript111,5838435,271
CSS93672292,239
SVG227175
JSON20052
Markdown113031

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity18.17
▷ Minimum class complexity1.00
▷ Maximum class complexity124.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes29
▷ Abstract classes413.79%
▷ Concrete classes2586.21%
▷ Final classes00.00%
Methods168
▷ Static methods74.17%
▷ Public methods12574.40%
▷ Protected methods3420.24%
▷ Private methods95.36%
Functions152
▷ Named functions152100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.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
25 PNG files occupy 0.18MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/tool-icon-email-notification-welcome-message.png5.02KB2.91KB▼ 42.12%
assets/libs/chosen/chosen-sprite.png1.65KB0.80KB▼ 51.60%
assets/img/tool-opt-in-icon-after-content.png4.82KB2.48KB▼ 48.62%
assets/img/email-provider-icon-aweber.png3.71KB1.99KB▼ 46.40%
assets/img/opt-in-icon-widget.png3.14KB1.66KB▼ 47.00%