71% speakout

Code Review | SpeakOut! Email Petitions

WordPress plugin SpeakOut! Email Petitions scored71%from 54 tests.

About plugin

  • Plugin page: speakout
  • Plugin version: 4.3.3.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Feb 15, 2015
  • Latest release: Nov 21, 2023
  • Number of updates: 549
  • Update frequency: every 5.8 days
  • Top authors: 123host (99.82%)

Code review

54 tests

User reviews

40 reviews

Install metrics

4,000+ active /288,127 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▲2.51ms] Passed 4 tests

A check of server-side resources used by SpeakOut! Email Petitions
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2838.80 ▼3.17
Dashboard /wp-admin3.72 ▲0.4257.60 ▲6.53
Posts /wp-admin/edit.php3.84 ▲0.4854.89 ▲6.57
Add New Post /wp-admin/post-new.php6.31 ▲0.4199.21 ▲0.85
Media Library /wp-admin/upload.php3.65 ▲0.4139.61 ▲5.82
Settings /wp-admin/admin.php?page=dk_speakout_settings3.8235.21
Signatures /wp-admin/admin.php?page=dk_speakout_signatures4.1337.72
Edit petition /wp-admin/admin.php?page=dk_speakout_addnew_page4.0238.69
Upgrade to Pro /wp-admin/admin.php?page=dk_speakout_upgrade3.6231.59
Shortcodes /wp-admin/admin.php?page=dk_speakout_top4.0038.00

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 636 new files
Database: 2 new tables, 10 new options
New tables
wp_dk_speakout_signatures
wp_dk_speakout_petitions
New WordPress options
dk_speakout_license_key_verified
dk_speakout_options
widget_dk_speakout_petition_widget
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
dk_speakout_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for SpeakOut! Email Petitions
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲9614.04 ▼0.302.16 ▲0.4338.37 ▼5.87
Dashboard /wp-admin2,241 ▲615.59 ▼0.0492.89 ▼7.3939.68 ▼2.52
Posts /wp-admin/edit.php2,143 ▲432.03 ▲0.0840.17 ▼2.4935.60 ▼1.19
Add New Post /wp-admin/post-new.php1,561 ▲2623.15 ▼1.88589.69 ▼17.4050.57 ▼21.37
Media Library /wp-admin/upload.php1,443 ▲434.18 ▼0.0093.77 ▼7.1941.86 ▼7.56
Settings /wp-admin/admin.php?page=dk_speakout_settings2,2002.1144.6647.87
Signatures /wp-admin/admin.php?page=dk_speakout_signatures1,0622.0627.6231.08
Edit petition /wp-admin/admin.php?page=dk_speakout_addnew_page1,7601.9831.2235.48
Upgrade to Pro /wp-admin/admin.php?page=dk_speakout_upgrade8552.0626.9728.54
Shortcodes /wp-admin/admin.php?page=dk_speakout_top9662.0724.3528.93

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=dk_speakout_settings
    • > Notice in wp-content/plugins/speakout/includes/class.settings.php+119
    Undefined index: g_recaptcha_secret_key
    • > GET request to /wp-admin/admin.php?page=dk_speakout_settings
    • > Notice in wp-content/plugins/speakout/includes/class.settings.php+121
    Undefined index: hcaptcha_site_key

SRP 0% 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
The following issues need your attention
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/speakout/languages/index.php
    • > /wp-content/plugins/speakout/includes/settings.view.php
    • > /wp-content/plugins/speakout/includes/upgrade.view.php
  • 63× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/speakout/speakout-email-petitions.php on line 34
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/speakout/includes/mailchimp/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/speakout/includes/mailchimp/guzzlehttp/psr7/src/MultipartStream.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/speakout/includes/mailchimp/guzzlehttp/promises/src/RejectedPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/speakout/includes/mailchimp/guzzlehttp/psr7/src/Request.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/speakout/includes/install.php:255
    • > PHP Fatal error
      Uncaught Error: Class 'MailchimpMarketing\\Configuration' not found in wp-content/plugins/speakout/includes/mailchimp/mailchimp/marketing/lib/ApiClient.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/speakout/includes/mailchimp/guzzlehttp/guzzle/src/Exception/BadResponseException.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/speakout/includes/petitions.view.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/speakout/includes/ajax.php:6

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 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Public-facing petition form), #2 (Form for creating and editing email petitions), #3 (Table view of existing petitions), #4 (Table view of collected signatures), #5 (Plugin settings screen), #6 (Sidebar widget), #7 (Pop-up Petition form (widget)), #8 (Email confirmation screen)
The official readme.txt might help

speakout/speakout-email-petitions.php 85% from 13 tests

The entry point to "SpeakOut! Email Petitions" version 4.3.3.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("speakout.php" instead of "speakout-email-petitions.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 345 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin113,233 lines of code in 523 files:
LanguageFilesBlank linesComment linesLines of code
PHP1819,88410,15252,469
PO File3315,20319,59834,735
SVG2624217,556
Markdown181,26703,962
JavaScript63032681,761
CSS548941,529
JSON13001,144
Bourne Shell113831
XML11020
YAML20017
make1409

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 1,909)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 112)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity64.68
▷ Minimum class complexity1.00
▷ Maximum class complexity1,909.00
Average method complexity6.68
▷ Minimum method complexity1.00
▷ Maximum method complexity112.00
Code structure
Namespaces13
Interfaces26
Traits3
Classes117
▷ Abstract classes00.00%
▷ Concrete classes117100.00%
▷ Final classes3429.06%
Methods1,759
▷ Static methods1669.44%
▷ Public methods1,29273.45%
▷ Protected methods34719.73%
▷ Private methods1206.82%
Functions164
▷ Named functions6439.02%
▷ Anonymous functions10060.98%
Constants64
▷ Global constants00.00%
▷ Class constants64100.00%
▷ Public constants5382.81%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
23 compressed PNG files occupy 0.22MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bg-progressbar-back-admin.png0.09KB0.13KB0.00%
images/lock.png0.40KB0.39KB▼ 2.66%
images/icon-emailpetitions-32.png1.57KB0.88KB▼ 44.23%
images/button-facebook.png2.11KB1.78KB▼ 15.38%
images/bg-button-facebook.png0.89KB1.40KB0.00%