10% trigger-happy

Code Review | Trigger Happy

WordPress plugin Trigger Happy scored10%from 54 tests.

About plugin

  • Plugin page: trigger-happy
  • Plugin version: 1.0.1.4
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Nov 13, 2017
  • Latest release: Nov 14, 2017
  • Number of updates: 13
  • Update frequency: every 0.1 days
  • Top authors: hotsource (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,108 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/trigger-happy/src/includes/class-triggerhappyexpressioncompiler.php+160
    The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence

Server metrics [RAM: ▼1.73MB] [CPU: ▼50.02ms] Passed 4 tests

This is a short check of server-side resources used by Trigger Happy
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.25 ▼1.215.61 ▼34.33
Dashboard /wp-admin2.27 ▼1.036.83 ▼46.84
Posts /wp-admin/edit.php2.27 ▼1.086.87 ▼39.15
Add New Post /wp-admin/post-new.php2.27 ▼3.617.39 ▼79.77
Media Library /wp-admin/upload.php2.27 ▼0.956.99 ▼25.21
Add New /wp-admin/post-new.php?post_type=th_flow2.276.62
All Flows /wp-admin/edit.php?post_type=th_flow2.277.42

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 71 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
triggerhappy_plugin_data

Browser metrics Passed 4 tests

A check of browser resources used by Trigger Happy
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲9513.25 ▼1.131.78 ▼0.0242.07 ▼8.35
Dashboard /wp-admin2,233 ▲454.84 ▼0.08110.57 ▲4.1838.63 ▼5.79
Posts /wp-admin/edit.php2,116 ▲271.99 ▼0.0039.92 ▲5.4336.32 ▲0.82
Add New Post /wp-admin/post-new.php1,558 ▲3923.46 ▲0.39647.52 ▼5.2162.67 ▲10.57
Media Library /wp-admin/upload.php1,412 ▲244.30 ▲0.16100.12 ▲4.5142.05 ▼3.79
Add New /wp-admin/post-new.php?post_type=th_flow1,8397.63140.2560.56
All Flows /wp-admin/edit.php?post_type=th_flow1,0772.0031.5127.98

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
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/trigger-happy/src/includes/class-triggerhappyexpressioncompiler.php+160
    The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • triggerhappy_plugin_data

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=th_flow
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/trigger-happy/src/includes/class-triggerhappyexpressioncompiler.php+160
    The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=th_flow
    • > Notice in wp-content/plugins/trigger-happy/src/api/FlowPluginsController.php+64
    Undefined property: stdClass::$name

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
Almost there! Just fix the following items
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/trigger-happy/src/nodes/woocommerce.php:855
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/trigger-happy/src/nodes/forms.php:64
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/trigger-happy/src/nodes/core.php:1182
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/trigger-happy/src/api/FlowController.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/trigger-happy/src/nodes/webhooks.php:85
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/trigger-happy/src/class-triggerhappy.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/trigger-happy/src/api/FlowHooksController.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/trigger-happy/src/api/FlowPluginsController.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: actions, triggers, visual scripting

trigger-happy/trigger-happy.php Passed 13 tests

"Trigger Happy" version 1.0.1.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
127 characters long description:
Connect your plugins and automate your workflow with Trigger Happy - a powerful flow-based visual scripting and automation tool

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin49,820 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript347,36919,65038,725
PHP205461994,721
CSS528553,647
SVG1002,671
JSON10056

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity25.75
▷ Minimum class complexity1.00
▷ Maximum class complexity96.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods129
▷ Static methods96.98%
▷ Public methods10480.62%
▷ Protected methods21.55%
▷ Private methods2317.83%
Functions98
▷ Named functions5354.08%
▷ Anonymous functions4545.92%
Constants22
▷ Global constants00.00%
▷ Class constants22100.00%
▷ Public constants22100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.12MB with 0.07MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png48.32KB19.25KB▼ 60.17%
assets/screenshot-2.png44.49KB18.33KB▼ 58.81%
assets/screenshot-1.png32.40KB13.61KB▼ 57.99%