68% conditional-logic-solution

Code Review | Conditional Logic Solutions (CLS)

WordPress plugin Conditional Logic Solutions (CLS) scored68%from 54 tests.

About plugin

  • Plugin page: conditional-logic...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.2
  • WordPress version: 6.3.1
  • First release: Jan 21, 2015
  • Latest release: May 10, 2015
  • Number of updates: 15
  • Update frequency: every 7.3 days
  • Top authors: irenem (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,444 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.16MB] [CPU: ▼48.55ms] Passed 4 tests

Analyzing server-side resources used by Conditional Logic Solutions (CLS)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.83 ▼0.6417.41 ▼26.76
Dashboard /wp-admin2.87 ▼0.4822.63 ▼47.06
Posts /wp-admin/edit.php2.87 ▼0.4920.80 ▼28.77
Add New Post /wp-admin/post-new.php2.87 ▼3.0217.79 ▼91.59
Media Library /wp-admin/upload.php2.87 ▼0.3719.35 ▼14.33
Conditional Logic /wp-admin/options-general.php?page=conditional-logic2.8720.17

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Conditional Logic Solutions (CLS)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.16 ▼1.201.84 ▲0.0743.92 ▲0.22
Dashboard /wp-admin2,213 ▲224.85 ▼0.02110.04 ▲1.9040.09 ▼10.86
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0241.77 ▲5.3036.79 ▲2.43
Add New Post /wp-admin/post-new.php1,536 ▼023.16 ▲0.06661.66 ▼41.6864.06 ▼0.09
Media Library /wp-admin/upload.php1,392 ▲44.18 ▼0.0194.78 ▼16.1141.37 ▼4.66
Conditional Logic /wp-admin/options-general.php?page=conditional-logic2,5592.2053.9691.87

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/conditional-logic-solution/conditional-logic-solution.php+38
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 769 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=conditional-logic
    • > Deprecated in wp-content/plugins/conditional-logic-solution/lib/basefield.php+11
    Function create_function() is deprecated

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 take a closer look at the following
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'class_cls' not found in wp-content/plugins/conditional-logic-solution/lib/user.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function basefield() in wp-content/plugins/conditional-logic-solution/views/widgets.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/conditional-logic-solution/lib/basefield.php:244
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/conditional-logic-solution/views/dashboard.php:13
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/conditional-logic-solution/conditional-logic-solution.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/conditional-logic-solution/views/settings.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'class_cls' not found in wp-content/plugins/conditional-logic-solution/lib/dashboard.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'class_cls' not found in wp-content/plugins/conditional-logic-solution/lib/widgets.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/conditional-logic-solution/lib/basefield.php:244
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/conditional-logic-solution/views/posts.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Main CLS page), #2 (CLS @ Dashboard), #3 (CLS @ Posts / Pages), #4 (Per posts/page CLS), #5 (CLS @ Widget page)
You can look at the official readme.txt

conditional-logic-solution/conditional-logic-solution.php 85% from 13 tests

Analyzing the main PHP file in "Conditional Logic Solutions (CLS)" version 1.2
Please take the time to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("3.4" instead of "3.8")
  • Description: Please keep the plugin description shorter than 140 characters (currently 361 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,404 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP13251951,565
JavaScript55281441
CSS161398

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity31.14
▷ Minimum class complexity2.00
▷ Maximum class complexity106.00
Average method complexity4.10
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods68
▷ Static methods68.82%
▷ Public methods68100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/imgs/logo.png2.76KB2.22KB▼ 19.75%
css/imgs/lock2.png1.49KB1.32KB▼ 11.18%
css/imgs/lock.png1.05KB0.90KB▼ 14.22%