10% campayn-email-newsletter-sign-up

Code Review | Campayn email newsletter sign-up

WordPress plugin Campayn email newsletter sign-up scored10%from 54 tests.

About plugin

  • Plugin page: campayn-email-new...
  • Plugin version: 0.193
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.4.2
  • WordPress version: 6.3.1
  • First release: Apr 16, 2013
  • Latest release: Jun 9, 2016
  • Number of updates: 40
  • Update frequency: every 28.8 days
  • Top authors: zoltan_lengyel (85%)nebojsac (17.5%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /4,930 total downloads

Benchmarks

Plugin footprint 23% 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
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/campayn-email-newsletter-sign-up/campayn_widget.php+71
    Function create_function() is deprecated

Server metrics [RAM: ▼1.81MB] [CPU: ▼54.67ms] Passed 4 tests

This is a short check of server-side resources used by Campayn email newsletter sign-up
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.18 ▼1.285.45 ▼36.80
Dashboard /wp-admin2.20 ▼1.108.63 ▼50.77
Posts /wp-admin/edit.php2.20 ▼1.166.33 ▼46.84
Add New Post /wp-admin/post-new.php2.20 ▼3.696.57 ▼84.26
Media Library /wp-admin/upload.php2.20 ▼1.037.89 ▼31.26
Campayn /wp-admin/options-general.php?page=ob_campayn2.216.02

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 15 new files
Database: 1 new table, 8 new options
New tables
wp_campayn_forms
New WordPress options
theysaidso_admin_options
campayn_forms_table
widget_recent-comments
widget_campayn_widget
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Campayn email newsletter sign-up: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,783 ▲2214.42 ▲0.071.83 ▼0.2742.16 ▼0.25
Dashboard /wp-admin2,199 ▲225.55 ▲0.0381.75 ▼21.7438.47 ▼5.13
Posts /wp-admin/edit.php2,104 ▲71.99 ▲0.0138.34 ▲0.7037.59 ▲4.00
Add New Post /wp-admin/post-new.php1,530 ▲220.86 ▼2.27647.31 ▼55.7153.70 ▼0.18
Media Library /wp-admin/upload.php1,404 ▲14.13 ▼0.04103.20 ▼12.9443.50 ▼3.66
Campayn /wp-admin/options-general.php?page=ob_campayn7952.0023.6529.80

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/campayn-email-newsletter-sign-up/campayn_widget.php+71
    Function create_function() is deprecated
  • Zombie tables detected upon uninstall: 1 table
    • wp_campayn_forms
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-comments
    • widget_campayn_widget
    • campayn_forms_table
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=ob_campayn
    • > Deprecated in wp-content/plugins/campayn-email-newsletter-sign-up/campayn_widget.php+71
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=ob_campayn
    • > Warning in wp-content/plugins/campayn-email-newsletter-sign-up/campayn.php+185
    Use of undefined constant campayn_get_form_message - assumed 'campayn_get_form_message' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=ob_campayn
    • > Warning in wp-content/plugins/campayn-email-newsletter-sign-up/campayn.php+299
    Use of undefined constant campayn_subscribe - assumed 'campayn_subscribe' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ob_campayn
    • > Notice in wp-content/plugins/campayn-email-newsletter-sign-up/campayn_settings.php+124
    Trying to access array offset on value of type bool

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
Please fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/campayn-email-newsletter-sign-up/campayn_widget.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/campayn-email-newsletter-sign-up/campayn_widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/campayn-email-newsletter-sign-up/campayn_install.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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: You can look at the official readme.txt

campayn-email-newsletter-sign-up/campayn.php 92% from 13 tests

The main file in "Campayn email newsletter sign-up" v. 0.193 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("campayn-email-newsletter-sign-up.php" instead of "campayn.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
Good job! No executable or dangerous file extensions detected671 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP6152128671

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity4.12
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods2779.41%
▷ Protected methods514.71%
▷ Private methods25.88%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 0.97MB with 0.62MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-1544x500.png83.02KB29.84KB▼ 64.06%
assets/screenshot-3.png104.13KB38.10KB▼ 63.41%
assets/banner-772x250.png42.19KB14.77KB▼ 64.99%
assets/screenshot-6.png193.87KB68.82KB▼ 64.50%
assets/screenshot-4.png116.94KB39.68KB▼ 66.07%