10% emma-emarketing-plugin

Code Review | Emma for WordPress

WordPress plugin Emma for WordPress scored10%from 54 tests.

About plugin

  • Plugin page: emma-emarketing-p...
  • Plugin version: 1.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.8.1
  • WordPress version: 6.3.1
  • First release: Jul 6, 2012
  • Latest release: Sep 1, 2017
  • Number of updates: 45
  • Update frequency: every 42.0 days
  • Top authors: brettshumaker (64.44%)ahsodesigns (37.78%)

Code review

54 tests

User reviews

8 reviews

Install metrics

900+ active /16,930 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/emma-emarketing-plugin/widget/class-emma-widget.php+120
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.41MB] [CPU: ▼4.45ms] Passed 4 tests

This is a short check of server-side resources used by Emma for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.4044.42 ▲0.98
Dashboard /wp-admin3.75 ▲0.4552.90 ▼4.44
Posts /wp-admin/edit.php3.80 ▲0.4551.41 ▲3.22
Add New Post /wp-admin/post-new.php6.29 ▲0.4090.81 ▼13.27
Media Library /wp-admin/upload.php3.61 ▲0.3838.51 ▼1.08
Emma for WordPress /wp-admin/options-general.php?page=emma_plugin_options3.5633.65

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 24 new files
Database: no new tables, 11 new options
New WordPress options
emma_advanced_settings
can_compress_scripts
widget_recent-comments
emma_account_information
emma_form_setup
widget_emma-widget
widget_theysaidso_widget
theysaidso_admin_options
emma_form_custom
db_upgraded
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Emma for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.27 ▲0.081.97 ▲0.0443.47 ▼0.55
Dashboard /wp-admin2,209 ▲295.61 ▼0.0998.52 ▲5.8143.21 ▼1.79
Posts /wp-admin/edit.php2,113 ▲132.03 ▲0.0635.06 ▼4.9833.45 ▼4.37
Add New Post /wp-admin/post-new.php1,538 ▲723.12 ▲0.21686.39 ▲38.1270.30 ▲17.35
Media Library /wp-admin/upload.php1,408 ▲54.20 ▲0.00103.55 ▲5.7043.51 ▼0.91
Emma for WordPress /wp-admin/options-general.php?page=emma_plugin_options9132.0327.5625.58

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_emma-widget
    • theysaidso_admin_options
    • widget_theysaidso_widget

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
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=emma_plugin_options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=emma_plugin_options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 13× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      include_once(EMMA_EMARKETING_PATH/class-emma-form.php): failed to open stream: No such file or directory in wp-content/plugins/emma-emarketing-plugin/shortcode/class-emma-shortcode.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/emma-emarketing-plugin/shortcode/class-emma-shortcode.php:6
    • > PHP Warning
      Use of undefined constant EMMA_EMARKETING_PATH - assumed 'EMMA_EMARKETING_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/emma-emarketing-plugin/widget/class-emma-widget.php on line 14
    • > PHP Warning
      include_once(): Failed opening 'EMMA_EMARKETING_PATH/class-emma-style.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/emma-emarketing-plugin/widget/class-emma-widget.php on line 14
    • > PHP Warning
      include_once(EMMA_EMARKETING_PATH/class-emma-style.php): failed to open stream: No such file or directory in wp-content/plugins/emma-emarketing-plugin/widget/class-emma-widget.php on line 14
    • > PHP Warning
      include_once(): Failed opening 'EMMA_EMARKETING_PATH/class-emma-style.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/emma-emarketing-plugin/widget/class-emma-widget.php on line 14
    • > PHP Warning
      include_once(): Failed opening 'EMMA_EMARKETING_PATH/class-emma-form.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/emma-emarketing-plugin/shortcode/class-emma-shortcode.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/emma-emarketing-plugin/widget/class-emma-widget.php:16
    • > PHP Warning
      Use of undefined constant EMMA_EMARKETING_PATH - assumed 'EMMA_EMARKETING_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/emma-emarketing-plugin/widget/class-emma-widget.php on line 14
    • > PHP Warning
      include_once(EMMA_EMARKETING_PATH/class-emma-style.php): failed to open stream: No such file or directory in wp-content/plugins/emma-emarketing-plugin/widget/class-emma-widget.php on line 14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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
10 plugin tags: subscription, plugin, form, widget, emma...

emma-emarketing-plugin/emma-for-wordpress.php 92% from 13 tests

The entry point to "Emma for WordPress" version 1.3.3 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("emma-emarketing-plugin.php" instead of "emma-for-wordpress.php")

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
Success! There were no dangerous files found in this plugin1,864 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP146054701,684
JavaScript24420131
CSS113149

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity13.73
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods106
▷ Static methods87.55%
▷ Public methods106100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/Emma_Logo_Horizontal.png17.78KB6.92KB▼ 61.10%
assets/images/emma_powered_by_logo.png2.14KB1.98KB▼ 7.54%
assets/images/e2ma_logo_35x33.png2.00KB1.86KB▼ 7.45%
assets/images/logo_32x25.png1.54KB1.30KB▼ 15.50%
assets/images/rss_20x20.png0.88KB0.72KB▼ 17.71%