10% simple-email-subscriber

Code Review | Simple Email Subscriber

WordPress plugin Simple Email Subscriber scored10%from 54 tests.

About plugin

  • Plugin page: simple-email-subs...
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Nov 6, 2012
  • Latest release: Nov 10, 2014
  • Number of updates: 44
  • Update frequency: every 16.7 days
  • Top authors: phil88530 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

80+ active /9,825 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin cannot be installed
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

Server metrics [RAM: ▼1.90MB] [CPU: ▼57.51ms] Passed 4 tests

Server-side resources used by Simple Email Subscriber
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.61 ▼41.32
Dashboard /wp-admin2.11 ▼1.206.98 ▼46.68
Posts /wp-admin/edit.php2.11 ▼1.257.56 ▼46.53
Add New Post /wp-admin/post-new.php2.11 ▼3.788.62 ▼95.50
Media Library /wp-admin/upload.php2.11 ▼1.125.99 ▼30.86
Simple Email Subscriber /wp-admin/options-general.php?page=settings_page2.116.41

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: 1 new table, 7 new options
New tables
wp_email_subscription
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
ses_db_version
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Simple Email Subscriber: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲3814.35 ▼0.011.81 ▼0.3041.44 ▼3.07
Dashboard /wp-admin2,201 ▲275.60 ▲0.0392.59 ▼10.4942.06 ▼1.45
Posts /wp-admin/edit.php2,106 ▲62.01 ▼0.0340.47 ▼2.4436.50 ▲2.14
Add New Post /wp-admin/post-new.php1,536 ▲1023.27 ▼0.09617.36 ▼56.8250.46 ▼3.40
Media Library /wp-admin/upload.php1,409 ▲94.17 ▲0.0297.56 ▼17.4943.59 ▼0.87
Simple Email Subscriber /wp-admin/options-general.php?page=settings_page7932.0224.8428.83

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the simple-email-subscriber-css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_email_subscription
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • ses_db_version
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=settings_page
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the simple-email-subscriber-css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=settings_page
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method simple_email_subscription_widget::register() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=settings_page
    • > User deprecated in wp-includes/functions.php+5453
    Function register_sidebar_widget is deprecated since version 2.8.0! Use wp_register_sidebar_widget() instead.
    • > GET request to /wp-admin/options-general.php?page=settings_page
    • > User deprecated in wp-includes/functions.php+5453
    Function register_widget_control is deprecated since version 2.8.0! Use wp_register_widget_control() instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 13× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/simple-email-subscriber/define.php:3
    • > PHP Warning
      include_once(): Failed opening 'WP_ADMIN_DIRtemplate.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/simple-email-subscriber/admin_pages/unsubscription_widget.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-email-subscriber/admin_pages/control_page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-email-subscriber/includes/widget.php:2
    • > PHP Warning
      Use of undefined constant WP_ADMIN_DIR - assumed 'WP_ADMIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-email-subscriber/admin_pages/subscription_widget.php on line 2
    • > PHP Warning
      include_once(): Failed opening 'WP_ADMIN_DIRtemplate.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/simple-email-subscriber/admin_pages/subscription_widget.php on line 2
    • > PHP Warning
      include_once(WP_ADMIN_DIRtemplate.php): failed to open stream: No such file or directory in wp-content/plugins/simple-email-subscriber/admin_pages/unsubscription_widget.php on line 2
    • > PHP Warning
      include_once(WP_ADMIN_DIRtemplate.php): failed to open stream: No such file or directory in wp-content/plugins/simple-email-subscriber/admin_pages/subscription_widget.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-email-subscriber/admin_pages/unsubscription_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/simple-email-subscriber/define.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 90% 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
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (adding subscription to widget demo1.png), #2 (manage subscribers in the wordpress admin demo2.png), #3 (what profile page looks like in widget demo3.png)
The official readme.txt is a good inspiration

simple-email-subscriber/simple_email_subscriber.php 85% from 13 tests

The entry point to "Simple Email Subscriber" version 2.3 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 171 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("simple-email-subscriber.php" instead of "simple_email_subscriber.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin435 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP107556408
Markdown15014
CSS12213

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity7.50
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods19
▷ Static methods421.05%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
7 PNG files occupy 0.19MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
example/demo3.png9.13KB4.22KB▼ 53.79%
example/demo1.png33.32KB10.76KB▼ 67.70%
example/demo2.png38.57KB14.41KB▼ 62.63%
screenshot-2.png38.57KB14.41KB▼ 62.63%
screenshot-3.png19.62KB8.78KB▼ 55.28%