10% contentoptin

Code Review | ContentOptin Lite - WP Content Upgrade Plugin

WordPress plugin ContentOptin Lite - WP Content Upgrade Plugin scored 10% from 54 tests.

About plugin

  • Plugin page: contentoptin
  • Plugin version: 1.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Nov 27, 2017
  • Latest release: Apr 3, 2018
  • Number of updates: 11
  • Update frequency: every 11.8 days
  • Top authors: markugwuanyi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 5,379 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/contentoptin/content-optin.php+36
    Undefined variable: wpdb

Server metrics [RAM: ▼0.48MB] [CPU: ▼16.55ms] Passed 4 tests

A check of server-side resources used by ContentOptin Lite - WP Content Upgrade Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0737.38 ▼7.89
Dashboard /wp-admin3.56 ▲0.2653.16 ▼0.84
Posts /wp-admin/edit.php3.68 ▲0.3261.91 ▲13.95
Add New Post /wp-admin/post-new.php3.39 ▼2.5041.16 ▼59.54
Media Library /wp-admin/upload.php3.47 ▲0.2437.69 ▲2.06
ContentOptin /wp-admin/edit.php?post_type=contentoptin3.6451.78
List Manager /wp-admin/edit.php?post_type=contentoptin&page=ms_co_maillist_page3.4642.19
Analytic Insight /wp-admin/edit.php?post_type=contentoptin&page=ms_co_statistic_page3.4334.68
Addons /wp-admin/edit.php?post_type=contentoptin&page=ms_co_integration_page3.4332.85
Add New Optin /wp-admin/post-new.php?post_type=contentoptin3.3936.55
Help /wp-admin/edit.php?post_type=contentoptin&page=ms_co_help3.4637.28

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 81 new files
Database: 2 new tables, 7 new options
New tables
wp_ms_co_emails
wp_ms_co_stats
New WordPress options
ms_co_db_version
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for ContentOptin Lite - WP Content Upgrade Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,073 ▲33815.59 ▲1.286.17 ▲4.4640.36 ▼7.60
Dashboard /wp-admin2,378 ▲1937.03 ▲2.04138.32 ▲24.7080.90 ▲33.66
Posts /wp-admin/edit.php2,302 ▲2133.87 ▲1.8648.79 ▲13.6464.57 ▲27.25
Add New Post /wp-admin/post-new.php1,557 ▲2423.56 ▲0.33652.41 ▼27.8836.10 ▼21.84
Media Library /wp-admin/upload.php1,438 ▲504.70 ▲0.5283.32 ▼23.2994.63 ▲47.56
ContentOptin /wp-admin/edit.php?post_type=contentoptin1,8213.9748.4163.98
List Manager /wp-admin/edit.php?post_type=contentoptin&page=ms_co_maillist_page1,1313.6239.4562.73
Analytic Insight /wp-admin/edit.php?post_type=contentoptin&page=ms_co_statistic_page1,3005.24116.1984.73
Addons /wp-admin/edit.php?post_type=contentoptin&page=ms_co_integration_page1,0033.5540.1365.59
Add New Optin /wp-admin/post-new.php?post_type=contentoptin2,1704.2762.51117.02
Help /wp-admin/edit.php?post_type=contentoptin&page=ms_co_help1,0683.6738.6280.17

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=contentoptin&page=ms_co_statistic_page
    • > Notice in wp-content/plugins/contentoptin/inc/admin/stat.php+17
    Undefined index: content_optin_search
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=contentoptin&page=ms_co_statistic_page
    • > Notice in wp-content/plugins/contentoptin/inc/admin/stat.php+88
    Undefined variable: selectedpost
    • > GET request to /wp-admin/edit.php?post_type=contentoptin&page=ms_co_statistic_page
    • > Warning in wp-content/plugins/contentoptin/inc/admin/stat.php+178
    Division by zero
    • > GET request to /wp-admin/edit.php?post_type=contentoptin&page=ms_co_statistic_page
    • > Notice in wp-content/plugins/contentoptin/inc/admin/stat.php+309
    Undefined variable: label
    • > GET request to /wp-admin/edit.php?post_type=contentoptin&page=ms_co_statistic_page
    • > Notice in wp-content/plugins/contentoptin/inc/admin/stat.php+310
    Undefined variable: email
    • > GET request to /wp-admin/edit.php?post_type=contentoptin&page=ms_co_statistic_page
    • > Notice in wp-content/plugins/contentoptin/inc/admin/stat.php+311
    Undefined variable: visit
    • > GET request to /wp-admin/edit.php?post_type=contentoptin&page=ms_co_statistic_page
    • > Notice in wp-content/plugins/contentoptin/inc/admin/stat.php+312
    Undefined variable: optin_click
    • > GET request to /wp-admin/edit.php?post_type=contentoptin&page=ms_co_integration_page
    • > Notice in wp-content/plugins/contentoptin/inc/admin/integration.php+11
    Undefined index: ms_co_int_menu_key
    • > GET request to /wp-admin/post-new.php?post_type=contentoptin
    • > Notice in wp-content/plugins/contentoptin/inc/admin/optin/metabox.php+429
    Undefined index: content_optin_meta_noncename
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=contentoptin
    • > Warning in wp-content/plugins/contentoptin/inc/admin/optin/metabox.php+101
    Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP)

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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/contentoptin/content-optin.php
  • 54× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      include(): Failed opening 'MS_CO_PLUGIN_DIR/inc/admin/misc/export_function.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/contentoptin/inc/admin_hook.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function remove_action() in wp-content/plugins/contentoptin/inc/popup/shortcode.php:4
    • > PHP Warning
      Use of undefined constant MS_CO_PLUGIN_DIR - assumed 'MS_CO_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/contentoptin/inc/admin_hook.php on line 6
    • > PHP Warning
      include(): Failed opening 'MS_CO_PLUGIN_DIR/inc/admin/list/list.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/contentoptin/inc/admin/maillist.php on line 14
    • > PHP Warning
      include(MS_CO_PLUGIN_DIR/inc/admin/integration.php): failed to open stream: No such file or directory in wp-content/plugins/contentoptin/inc/admin_hook.php on line 13
    • > PHP Warning
      Use of undefined constant MS_CO_PLUGIN_DIR - assumed 'MS_CO_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/contentoptin/inc/admin_hook.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contentoptin/inc/popup/ajax_process.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ms_co_popup_heading() in wp-content/plugins/contentoptin/inc/popup/template/theme4.php:11
    • > PHP Warning
      include(): Failed opening 'MS_CO_PLUGIN_DIR/inc/admin/maillist.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/contentoptin/inc/admin_hook.php on line 12
    • > PHP Warning
      include(): Failed opening 'MS_CO_PLUGIN_DIR/inc/admin/optin/optin_setting.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/contentoptin/inc/admin_hook.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: content upgrade, content bonus, lead magnet, lead generation, list building

contentoptin/content-optin.php 92% from 13 tests

The principal PHP file in "ContentOptin Lite - WP Content Upgrade Plugin" v. 1.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("contentoptin.php" instead of "content-optin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin5,497 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript95884532,429
PHP309041081,927
CSS3244221,140
SVG1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions59
▷ Named functions59100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
26 PNG files occupy 1.10MB with 0.61MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/popup/template/images/theme3.png21.60KB11.47KB▼ 46.89%
inc/popup/template/images/sidebox.PNG46.60KB17.55KB▼ 62.33%
inc/popup/template/images/theme4i.png63.86KB29.73KB▼ 53.45%
assets/screenshot-1.PNG54.15KB19.76KB▼ 63.51%
inc/popup/template/images/theme6.png73.61KB34.66KB▼ 52.92%