78% wp-exit-optin

Code Review | WP Exit Optin

WordPress plugin WP Exit Optin scored78%from 54 tests.

About plugin

  • Plugin page: wp-exit-optin
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Jan 25, 2016
  • Latest release: Jan 18, 2016
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: eric_wijaya_87 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /559 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▼0.87ms] Passed 4 tests

Analyzing server-side resources used by WP Exit Optin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0937.79 ▼2.92
Dashboard /wp-admin3.50 ▲0.2047.70 ▼2.01
Posts /wp-admin/edit.php3.61 ▲0.2649.98 ▲1.19
Add New Post /wp-admin/post-new.php6.08 ▲0.2095.41 ▲1.28
Media Library /wp-admin/upload.php3.42 ▲0.2035.57 ▲0.26

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 328 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WP Exit Optin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7014.47 ▲0.041.68 ▼0.0541.68 ▼2.09
Dashboard /wp-admin2,222 ▲374.87 ▼0.99106.87 ▲3.1540.71 ▲1.22
Posts /wp-admin/edit.php2,105 ▲162.05 ▲0.0139.40 ▲1.0635.11 ▼2.06
Add New Post /wp-admin/post-new.php1,555 ▲2218.53 ▼4.68618.70 ▼32.5444.35 ▼7.83
Media Library /wp-admin/upload.php1,407 ▲224.21 ▼0.0794.57 ▼6.5541.35 ▲0.22

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-exit-optin/wp-exit-optin.php
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-exit-optin/lib/cmb2/init.php:119
    • > PHP Notice
      Undefined variable: test_root in wp-content/plugins/wp-exit-optin/lib/cmb2/tests/bootstrap.php on line 24
    • > PHP Fatal error
      require_once(): Failed opening required '/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-exit-optin/lib/cmb2/tests/bootstrap.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-exit-optin/lib/cmb2/example-functions.php:68
    • > PHP Warning
      require_once(/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/wp-exit-optin/lib/cmb2/tests/bootstrap.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wp-exit-optin/lib/cmb2/tests/cmb-tests-base.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-exit-optin/lib/cmb2/bootstrap.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wp-exit-optin/lib/cmb2/tests/cmb-tests-base.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wp-exit-optin/lib/cmb2/tests/cmb-tests-base.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wp-exit-optin/lib/cmb2/tests/cmb-tests-base.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Popup show when visitor is about to exit your site), #2 (Admin Options)
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === wp-exit-optin === )
The official readme.txt might help

wp-exit-optin/wp-exit-optin.php 92% from 13 tests

This is the main PHP file of "WP Exit Optin" version 0.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin88,805 lines of code in 178 files:
LanguageFilesBlank linesComment linesLines of code
XML20047,741
PO File11912,73116,32929,151
PHP241,4112,4274,922
CSS51,0331,0224,116
Sass11168231,116
JavaScript7216179928
Markdown41720487
YAML290152
JSON300121
Bourne Shell119771

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity26.91
▷ Minimum class complexity1.00
▷ Maximum class complexity121.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes23
▷ Abstract classes14.35%
▷ Concrete classes2295.65%
▷ Final classes00.00%
Methods341
▷ Static methods319.09%
▷ Public methods32294.43%
▷ Protected methods102.93%
▷ Private methods92.64%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants880.00%
▷ Class constants220.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
lib/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
lib/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
lib/cmb2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
lib/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%