63% pretty-opt-in-lite

Code Review | Pretty Opt In Lite - Content Locker for Lead Generation

WordPress plugin Pretty Opt In Lite - Content Locker for Lead Generation scored63%from 54 tests.

About plugin

  • Plugin page: pretty-opt-in-lite
  • Plugin version: 1.3.11
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Dec 23, 2020
  • Latest release: Apr 8, 2023
  • Number of updates: 50
  • Update frequency: every 16.7 days
  • Top authors: darell (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,301 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.12MB] [CPU: ▲29.59ms] 75% from 4 tests

An overview of server-side resources used by Pretty Opt In Lite - Content Locker for Lead Generation
The following require your attention
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.12MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.90 ▲5.4370.47 ▲30.68
Dashboard /wp-admin8.92 ▲5.6175.73 ▲30.71
Posts /wp-admin/edit.php8.92 ▲5.5685.82 ▲39.97
Add New Post /wp-admin/post-new.php9.78 ▲3.89109.66 ▲23.63
Media Library /wp-admin/upload.php8.92 ▲5.6867.14 ▲33.34
Freemius Debug [v.2.5.4.2] /wp-admin/admin.php?page=freemius8.9259.99

Server storage [IO: ▲10.32MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2,918 new files
Database: 1 new table, 11 new options
New tables
wp_pretty_leads
New WordPress options
db_upgraded
fs_debug_mode
fs_active_plugins
pretty_predefine_privacy
widget_recent-posts
fs_accounts
widget_recent-comments
theysaidso_admin_options
pretty_predefine_terms
can_compress_scripts
...

Browser metrics Passed 4 tests

Pretty Opt In Lite - Content Locker for Lead Generation: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,968 ▲20713.88 ▼0.3910.30 ▲8.7328.12 ▼11.78
Dashboard /wp-admin2,225 ▲485.56 ▼0.1081.71 ▼6.5239.40 ▼0.73
Posts /wp-admin/edit.php2,137 ▲372.02 ▲0.0039.90 ▲4.7240.07 ▼0.78
Add New Post /wp-admin/post-new.php1,553 ▲2717.98 ▼5.60603.08 ▼44.1558.27 ▼0.33
Media Library /wp-admin/upload.php1,433 ▲334.21 ▲0.0295.49 ▼7.7845.35 ▲1.68
Freemius Debug [v.2.5.4.2] /wp-admin/admin.php?page=freemius1,0881.6623.9925.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/pretty-opt-in-lite/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie tables detected upon uninstall: 1 table
    • wp_pretty_leads
  • Zombie WordPress options were found after uninstall: 11 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • pretty_predefine_privacy
    • can_compress_scripts
    • fs_debug_mode
    • db_upgraded
    • fs_accounts
    • fs_active_plugins
    • theysaidso_admin_options
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 50× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/pretty-opt-in-lite/admin/views/integrations/sections/tab-apps.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/pretty-opt-in-lite/admin/views/locker/list/widget-popup.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/pretty-opt-in-lite/admin/views/settings/sections/tab-notifications.php:3
    • > PHP Warning
      Use of undefined constant PRETTY_OPT_IN_URL - assumed 'PRETTY_OPT_IN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/pretty-opt-in-lite/admin/views/locker/list/widget-popup.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/pretty-opt-in-lite/admin/views/dashboard/content.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/pretty-opt-in-lite/admin/views/settings/content.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/pretty-opt-in-lite/admin/views/leads/header.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pretty_opt_in_get_addon_data() in wp-content/plugins/pretty-opt-in-lite/admin/views/integrations/popups/freshmail.php:2
    • > PHP Warning
      Use of undefined constant PRETTY_OPT_IN_URL - assumed 'PRETTY_OPT_IN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/pretty-opt-in-lite/admin/views/locker/list/widget-popup.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/pretty-opt-in-lite/admin/views/settings/sections/tab-subscription.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #1, #10, #11, #12, #13, #14, #2, #3, #4, #5, #6, #7, #8, #9 in pretty-opt-in-lite/assets to your readme.txt
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt is a good inspiration

pretty-opt-in-lite/pretty-opt-in-lite.php Passed 13 tests

The main PHP script in "Pretty Opt In Lite - Content Locker for Lead Generation" version 1.3.11 is automatically included on every request by WordPress
128 characters long description:
Pretty Opt In makes you can create the premium content locker (e.g. downloads, discounts, videos and so on) for lead generation.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin44,868 lines of code in 1,985 files:
LanguageFilesBlank linesComment linesLines of code
PHP1949,26318,95537,260
CSS18525504,198
SVG1,738012,069
JavaScript323654571,083
Markdown1680214
HTML20044

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,079)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity59.95
▷ Minimum class complexity1.00
▷ Maximum class complexity3,079.00
Average method complexity4.31
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes79
▷ Abstract classes67.59%
▷ Concrete classes7392.41%
▷ Final classes00.00%
Methods1,441
▷ Static methods20314.09%
▷ Public methods1,03571.83%
▷ Protected methods251.73%
▷ Private methods38126.44%
Functions131
▷ Named functions131100.00%
▷ Anonymous functions00.00%
Constants152
▷ Global constants10166.45%
▷ Class constants5133.55%
▷ Public constants51100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
25 PNG files occupy 5.00MB with 2.74MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/template/pretty-minimal.png4.75KB2.45KB▼ 48.48%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/images/welcome/pretty-edit-locker.png154.47KB45.33KB▼ 70.66%
assets/images/template/black-bg.png3,353.87KB1,176.73KB▼ 64.91%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%