77% logic-hop

Code Review | Logic Hop - Dynamic Content Personalization for WordPress

WordPress plugin Logic Hop - Dynamic Content Personalization for WordPress scored77%from 54 tests.

About plugin

  • Plugin page: logic-hop
  • Plugin version: 3.8.8
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.4.1
  • WordPress version: 6.3.1
  • First release: May 5, 2017
  • Latest release: Nov 9, 2023
  • Number of updates: 146
  • Update frequency: every 16.3 days
  • Top authors: logichop (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

100+ active /15,924 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.90MB] [CPU: ▲16.08ms] 75% from 4 tests

Analyzing server-side resources used by Logic Hop - Dynamic Content Personalization for WordPress
The following require your attention
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,417.53ms on /wp-admin/admin.php?page=logichop-dashboard)
PageMemory (MB)CPU Time (ms)
Home /5.35 ▲1.8967.93 ▲27.32
Dashboard /wp-admin5.23 ▲1.8875.69 ▲15.12
Posts /wp-admin/edit.php5.28 ▲1.9257.70 ▲6.97
Add New Post /wp-admin/post-new.php7.87 ▲1.98115.08 ▲20.64
Media Library /wp-admin/upload.php5.16 ▲1.9358.09 ▲21.59
Settings /wp-admin/admin.php?page=logichop-settings5.19338.19
Dashboard /wp-admin/admin.php?page=logichop-dashboard6.431,417.53
Integrations /wp-admin/admin.php?page=logichop-integrations5.1346.30

Server storage [IO: ▲3.58MB] [DB: ▲0.09MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 105 new files
Database: 1 new table, 12 new options
New tables
wp_logichop_local_storage
New WordPress options
logichop_data
db_upgraded
logichop_local_storage
theysaidso_admin_options
logichop-settings
logichop_instance
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
...

Browser metrics Passed 4 tests

Checking browser requirements for Logic Hop - Dynamic Content Personalization for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,986 ▲19914.30 ▼0.051.81 ▼0.2143.05 ▼0.08
Dashboard /wp-admin2,353 ▲1765.57 ▼0.0883.56 ▼18.1871.86 ▲29.01
Posts /wp-admin/edit.php2,158 ▲581.98 ▼0.0335.52 ▼4.9334.59 ▲0.88
Add New Post /wp-admin/post-new.php2,218 ▲69223.42 ▲0.25765.73 ▲83.8261.52 ▼2.41
Media Library /wp-admin/upload.php1,455 ▲554.23 ▲0.02110.64 ▲6.1875.85 ▲29.07
Settings /wp-admin/admin.php?page=logichop-settings1,4191.6825.5138.70
Dashboard /wp-admin/admin.php?page=logichop-dashboard8902.0124.1028.80
Integrations /wp-admin/admin.php?page=logichop-integrations1,0172.0024.1027.21

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

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 0% 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
Almost there! Just fix the following items
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/logic-hop/admin/partials/conditions.php
    • > /wp-content/plugins/logic-hop/admin/partials/dashboard.php
    • > /wp-content/plugins/logic-hop/admin/index.php
    • > /wp-content/plugins/logic-hop/logichop.php
    • > /wp-content/plugins/logic-hop/admin/partials/insights.php
    • > /wp-content/plugins/logic-hop/admin/partials/settings.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Jaybizzle\\CrawlerDetect\\Fixtures\\AbstractProvider' not found in wp-content/plugins/logic-hop/includes/classes/CrawlerDetect/Fixtures/Headers.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/logic-hop/admin/partials/instructions.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Jaybizzle\\CrawlerDetect\\Fixtures\\AbstractProvider' not found in wp-content/plugins/logic-hop/includes/classes/CrawlerDetect/Fixtures/Crawlers.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/logic-hop/admin/partials/addons.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/logic-hop/admin/notices.php:85
    • > PHP Fatal error
      Uncaught Error: Class 'Jaybizzle\\CrawlerDetect\\Fixtures\\AbstractProvider' not found in wp-content/plugins/logic-hop/includes/classes/CrawlerDetect/Fixtures/Exclusions.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: crm, zoho, dynamic content, hubspot, personalization...

logic-hop/logichop.php 62% from 13 tests

The main PHP file in "Logic Hop - Dynamic Content Personalization for WordPress" ver. 3.8.8 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("logic-hop.php" instead of "logichop.php")
  • Domain Path: The domain path should use only dashes and lowercase characters ("languages")
  • Domain Path: The domain path should be prefixed with a forward slash character ("/languages")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: Keep the plugin description shorter than 140 characters (currently 236 characters long)

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
Good job! No executable or dangerous file extensions detected28,833 lines of code in 83 files:
LanguageFilesBlank linesComment linesLines of code
PHP421,6783,64513,709
JavaScript251,9301,34013,060
CSS12167251,197
PO File1363480798
SVG20237
Sass12032

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of 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.54
Average class complexity53.37
▷ Minimum class complexity1.00
▷ Maximum class complexity359.00
Average method complexity5.04
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes30
▷ Abstract classes13.33%
▷ Concrete classes2996.67%
▷ Final classes00.00%
Methods369
▷ Static methods349.21%
▷ Public methods35395.66%
▷ Protected methods41.08%
▷ Private methods123.25%
Functions55
▷ Named functions712.73%
▷ Anonymous functions4887.27%
Constants19
▷ Global constants00.00%
▷ Class constants19100.00%
▷ Public constants19100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
13 PNG files occupy 1.84MB with 1.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-9.png249.26KB101.78KB▼ 59.17%
screenshot-6.png65.16KB26.77KB▼ 58.93%
screenshot-3.png283.79KB120.15KB▼ 57.66%
admin/images/icon.png0.34KB0.23KB▼ 32.56%
screenshot-2.png488.21KB181.34KB▼ 62.86%