62% if-so

Code Review | If-So Dynamic Content Personalization

WordPress plugin If-So Dynamic Content Personalization scored62%from 54 tests.

About plugin

  • Plugin page: if-so
  • Plugin version: 1.6.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-6.4
  • WordPress version: 6.3.1
  • First release: Mar 23, 2017
  • Latest release: Nov 17, 2023
  • Number of updates: 431
  • Update frequency: every 5.6 days
  • Top authors: ifso (100%)

Code review

54 tests

User reviews

74 reviews

Install metrics

7,000+ active /148,144 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲2.72MB] [CPU: ▲15.04ms] 75% from 4 tests

An overview of server-side resources used by If-So Dynamic Content Personalization
Please take the time to fix the following items
  • CPU: You should keep total CPU usage under 500.00ms (currently 1,168.41ms on /wp-admin/admin.php?page=wpcdd_admin_geo_license)
PageMemory (MB)CPU Time (ms)
Home /6.16 ▲2.7061.37 ▲20.20
Dashboard /wp-admin6.02 ▲2.7258.99 ▲9.52
Posts /wp-admin/edit.php6.06 ▲2.7062.74 ▲17.24
Add New Post /wp-admin/post-new.php8.79 ▲2.90108.46 ▲13.18
Media Library /wp-admin/upload.php5.98 ▲2.7557.44 ▲23.91
All Triggers /wp-admin/edit.php?post_type=ifso_triggers5.9853.98
License /wp-admin/admin.php?page=wpcdd_admin_menu_license5.8847.88
Settings /wp-admin/admin.php?page=wpcdd_admin_menu_settings5.9551.74
/wp-admin/admin.php?page=wpcdd_admin_location_generator5.8550.21
Geolocation /wp-admin/admin.php?page=wpcdd_admin_geo_license6.041,168.41
Audiences /wp-admin/admin.php?page=wpcdd_admin_menu_groups_list5.8648.43

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 373 new files
Database: 2 new tables, 13 new options
New tables
wp_ifso_daily_sessions
wp_ifso_local_user
New WordPress options
theysaidso_admin_options
jal_db_version
db_upgraded
widget_recent-posts
75
ifso_wp_version
100
60
90
can_compress_scripts
...

Browser metrics Passed 4 tests

An overview of browser requirements for If-So Dynamic Content Personalization
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,940 ▲17813.47 ▼0.9313.37 ▲11.7344.93 ▼2.13
Dashboard /wp-admin2,254 ▲805.55 ▼0.1294.93 ▼4.1376.98 ▲33.58
Posts /wp-admin/edit.php2,159 ▲591.97 ▲0.0140.13 ▼0.5739.52 ▲1.70
Add New Post /wp-admin/post-new.php6,424 ▲4,89829.49 ▲6.51884.39 ▲235.7839.55 ▼13.75
Media Library /wp-admin/upload.php1,453 ▲534.25 ▲0.04103.76 ▼3.9646.36 ▲0.17
All Triggers /wp-admin/edit.php?post_type=ifso_triggers1,1531.9335.0632.71
License /wp-admin/admin.php?page=wpcdd_admin_menu_license1,0623.6363.9036.70
Settings /wp-admin/admin.php?page=wpcdd_admin_menu_settings1,4453.3859.1534.04
/wp-admin/admin.php?page=wpcdd_admin_location_generator9515.4777.9218.43
Geolocation /wp-admin/admin.php?page=wpcdd_admin_geo_license1,5235.0072.4358.14
Audiences /wp-admin/admin.php?page=wpcdd_admin_menu_groups_list1,0003.7251.0440.51

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_ifso_local_user
    • wp_ifso_daily_sessions
  • This plugin does not fully uninstall, leaving 13 options in the database
    • ifso_wp_version
    • theysaidso_admin_options
    • 90
    • jal_db_version
    • can_compress_scripts
    • 100
    • db_upgraded
    • widget_recent-comments
    • 95
    • 75
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/if-so/admin/partials/ifso_location_generator_page_display.php
    • > /wp-content/plugins/if-so/rest/ifso_update_sessions.php
    • > /wp-content/plugins/if-so/public/partials/wp-if-so-display.php
    • > /wp-content/plugins/if-so/admin/partials/ifso_trigger_settings_metabox.php
    • > /wp-content/plugins/if-so/rest/ifso_activate.php
  • 153× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\PluginUpdateChecker\\v5p0\\Vcs\\Api' not found in wp-content/plugins/if-so/extensions/extension-base/lib/plugin-update-checker/Puc/v5p0/Vcs/GitHubApi.php:8
    • > PHP Warning
      require_once(IFSO_PLUGIN_BASE_DIRpublic/models/triggers/ifso-triggers-model.class.php): failed to open stream: No such file or directory in wp-content/plugins/if-so/public/services/triggers-service/triggers-service.class.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'YahnisElsts\\PluginUpdateChecker\\v5p0\\DebugBar\\Panel' not found in wp-content/plugins/if-so/extensions/extension-base/lib/plugin-update-checker/Puc/v5p0/DebugBar/PluginPanel.php:8
    • > PHP Warning
      require_once(IFSO_PLUGIN_BASE_DIRextensions/ifso-gutenberg-blocks/ifso-gutenberg-block-base.class.php): failed to open stream: No such file or directory in wp-content/plugins/if-so/extensions/ifso-gutenberg-blocks/ifso-standalone-conditions-gutenberg-block/ifso-gutenberg-standalone-conditions-block.class.php on line 12
    • > PHP Warning
      Use of undefined constant IFSO_PLUGIN_BASE_DIR - assumed 'IFSO_PLUGIN_BASE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/if-so/public/services/triggers-service/triggers-service.class.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'IFSO_PLUGIN_BASE_DIRextensions/ifso-gutenberg-blocks/ifso-gutenberg-block-base.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/if-so/extensions/ifso-gutenberg-blocks/ifso-guntenberg-block/ifso-gutenberg-block.class.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function IfSo\\PublicFace\\Services\\TriggersService\\Triggers\\plugin_dir_path() in wp-content/plugins/if-so/public/services/triggers-service/triggers/impl/user-roles-trigger.class.php:9
    • > PHP Warning
      Use of undefined constant IFSO_PLUGIN_BASE_DIR - assumed 'IFSO_PLUGIN_BASE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/if-so/public/models/page-visits/ifso_page_visits_service.php on line 11
    • > PHP Warning
      Use of undefined constant IFSO_PLUGIN_BASE_DIR - assumed 'IFSO_PLUGIN_BASE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/if-so/extensions/ifso-extended-shortcodes/extended-shortcodes.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function IfSo\\PublicFace\\Services\\TriggersService\\Triggers\\plugin_dir_path() in wp-content/plugins/if-so/public/services/triggers-service/triggers/impl/user-details-trigger.class.php:9

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/admin.php?page=wpcdd_admin_location_generator
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?key=AIzaSyD_84lpDfAJL1Tee8nDHcATxb4QmSZjgTU&language=en&libraries=places&callback=initAutocomplete&ver=1.6.3.1 169:309 "google.maps.event.addDomListener() is deprecated, use the standard\naddEventListener() method instead:\nhttps://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener\nThe feature will continue to work and there is no plan to decommission\nit."
    • > GET request to /wp-admin/admin.php?page=wpcdd_admin_location_generator
    • > 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: Cannot read properties of null (reading 'ifsoLocGenPipe')" "TypeError: Cannot read properties of null (reading 'ifsoLocGenPipe')\n at LocationGenerator.openerHasPipe (/wp-admin/admin.php?page=wpcdd_admin_location_generator:458:42)\n at LocationGenerator.initListeners (/wp-admin/admin.php?page=wpcdd_admin_location_generator:357:21)\n at new LocationGenerator (/wp-admin/admin.php?page=wpcdd_admin_location_generator:330:14)\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=wpcdd_admin_location_generator:318:21)\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/admin.php?page=wpcdd_admin_location_generator
    • > 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: Cannot read properties of null (reading 'ifsoLocGenPipe')

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 25 tag instead of maximum 10
The official readme.txt might help

if-so/if-so.php Passed 13 tests

"If-So Dynamic Content Personalization" version 1.6.3.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
116 characters long description:
Display different content to different visitors. Simple to use, just select a condition and set content accordingly.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin40,109 lines of code in 285 files:
LanguageFilesBlank linesComment linesLines of code
PHP1804,1955,04120,658
CSS224821417,101
JavaScript208263983,470
SVG3002,970
Sass1434341,768
PO File264995881,765
LESS1434441,758
JSON480317
Markdown1840299
XML1003

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity18.33
▷ Minimum class complexity1.00
▷ Maximum class complexity223.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity89.00
Code structure
Namespaces39
Interfaces5
Traits1
Classes167
▷ Abstract classes2011.98%
▷ Concrete classes14788.02%
▷ Final classes00.00%
Methods1,176
▷ Static methods1038.76%
▷ Public methods77365.73%
▷ Protected methods18015.31%
▷ Private methods22318.96%
Functions79
▷ Named functions4556.96%
▷ Anonymous functions3443.04%
Constants62
▷ Global constants1524.19%
▷ Class constants4775.81%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/ifso-logo.png1.44KB0.61KB▼ 57.99%
admin/images/Help.png9.87KB10.31KB0.00%
admin/images/IfSo_logo25X8.png1.47KB0.67KB▼ 54.22%
admin/images/flags.png77.51KB25.56KB▼ 67.03%
admin/images/logo-256x256.png1.44KB0.61KB▼ 57.99%