78% conditional-content-cf-lite

Code Review | Conditional Content by Crowd Favorite

WordPress plugin Conditional Content by Crowd Favorite scored 78% from 54 tests.

About plugin

  • Plugin page: conditional-conte...
  • Plugin version: 2.1.2
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.0
  • WordPress version: 6.3.1
  • First release: Mar 3, 2020
  • Latest release: Jun 24, 2022
  • Number of updates: 30
  • Update frequency: every 28.1 days
  • Top authors: crowdfavorite (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,756 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼7.40ms] Passed 4 tests

Server-side resources used by Conditional Content by Crowd Favorite
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0834.28 ▼3.70
Dashboard /wp-admin3.38 ▲0.0744.61 ▼3.94
Posts /wp-admin/edit.php3.43 ▲0.0743.38 ▼4.86
Add New Post /wp-admin/post-new.php5.96 ▲0.0888.75 ▼17.11
Media Library /wp-admin/upload.php3.30 ▲0.0735.69 ▲2.98
Add New /wp-admin/post-new.php?post_type=cf_cc_condition3.4557.25
Settings /wp-admin/edit.php?post_type=cf_cc_condition&page=cf-conditional-content-settings3.3534.05
All Conditions /wp-admin/edit.php?post_type=cf_cc_condition3.3536.44

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 79 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Conditional Content by Crowd Favorite
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,932 ▲19713.64 ▼1.097.96 ▲6.3642.98 ▲1.16
Dashboard /wp-admin2,240 ▲554.81 ▼0.0994.52 ▼16.7340.18 ▼3.65
Posts /wp-admin/edit.php2,120 ▲312.01 ▼0.0334.45 ▼6.0234.05 ▼1.06
Add New Post /wp-admin/post-new.php6,423 ▲4,89525.69 ▲7.50870.74 ▲270.8461.15 ▲3.09
Media Library /wp-admin/upload.php1,419 ▲314.17 ▼0.0096.60 ▼5.1843.55 ▼0.18
Add New /wp-admin/post-new.php?post_type=cf_cc_condition2,4583.6876.2041.64
Settings /wp-admin/edit.php?post_type=cf_cc_condition&page=cf-conditional-content-settings1,0432.4628.0855.12
All Conditions /wp-admin/edit.php?post_type=cf_cc_condition1,1362.8236.3433.46

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means 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
Please fix the following items
  • 25× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: condition_type in wp-content/plugins/conditional-content-cf-lite/admin/views/partials/field-user-behavior-logged.php on line 11
    • > PHP Notice
      Undefined variable: rule_user_behavior in wp-content/plugins/conditional-content-cf-lite/admin/views/partials/field-user-behavior-returning.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function selected() in wp-content/plugins/conditional-content-cf-lite/admin/views/partials/field-operator.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/conditional-content-cf-lite/admin/views/partials/field-end-date.php:27
    • > PHP Notice
      Undefined variable: current_datetime_count in wp-content/plugins/conditional-content-cf-lite/admin/views/partials/field-start-date.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/conditional-content-cf-lite/admin/views/partials/field-user-behavior-returning.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/conditional-content-cf-lite/admin/views/partials/field-start-date.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/conditional-content-cf-lite/admin/views/partials/field-trigger-select.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/conditional-content-cf-lite/admin/views/partials/field-user-behavior-returning-custom.php:19
    • > PHP Notice
      Undefined variable: condition_type in wp-content/plugins/conditional-content-cf-lite/admin/views/partials/field-start-date.php on line 14

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=cf_cc_condition&page=cf-conditional-content-settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).disableSelection is not a function" "TypeError: $(...).disableSelection is not a function\n at Object.initObjects (/wp-content/plugins/conditional-content-cf-lite/admin/build/app.js?ver=1583226450:128:63)\n at Object.init (/wp-content/plugins/conditional-content-cf-lite/admin/build/app.js?ver=1583226450:15:25)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/conditional-content-cf-lite/admin/build/app.js?ver=1583226450:158:23)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit.php?post_type=cf_cc_condition&page=cf-conditional-content-settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).disableSelection is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: replace content, dynamic web content, adaptive content, crowd favorite, website personalization...

conditional-content-cf-lite/conditional-content-cf-lite.php 92% from 13 tests

Analyzing the main PHP file in "Conditional Content by Crowd Favorite" version 2.1.2
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
No dangerous file extensions were detected14,475 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
PHP388872,5324,960
JSON1003,717
CSS9552522,231
JavaScript137042052,134
Sass623221,431
SVG1001
XML1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity39.15
▷ Minimum class complexity5.00
▷ Maximum class complexity134.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods192
▷ Static methods2110.94%
▷ Public methods11760.94%
▷ Protected methods157.81%
▷ Private methods6031.25%
Functions19
▷ Named functions1684.21%
▷ Anonymous functions315.79%
Constants36
▷ Global constants2672.22%
▷ Class constants1027.78%
▷ Public constants990.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.08MB with 0.06MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/flags.png77.51KB25.56KB▼ 67.03%
admin/assets/images/logo.png1.65KB0.22KB▼ 86.91%