78% trigger-warning-deluxe

Code Review | Trigger Warning Deluxe

WordPress plugin Trigger Warning Deluxe scored78%from 54 tests.

About plugin

  • Plugin page: trigger-warning-d...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Jun 29, 2014
  • Latest release: May 15, 2015
  • Number of updates: 7
  • Update frequency: every 45.9 days
  • Top authors: jweathe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /985 total downloads

Benchmarks

Plugin footprint 83% 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 gracefully, with no errors

Server metrics [RAM: ▼0.03MB] [CPU: ▼15.28ms] Passed 4 tests

This is a short check of server-side resources used by Trigger Warning Deluxe
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0635.72 ▼2.69
Dashboard /wp-admin3.42 ▲0.0742.00 ▼17.92
Posts /wp-admin/edit.php3.44 ▲0.0843.51 ▼2.04
Add New Post /wp-admin/post-new.php5.55 ▼0.3366.80 ▼38.46
Media Library /wp-admin/upload.php3.34 ▲0.1137.12 ▲6.10

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Trigger Warning Deluxe
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,937 ▲19114.05 ▼0.358.10 ▲6.2637.86 ▼5.01
Dashboard /wp-admin2,237 ▲525.09 ▲0.21111.81 ▼2.2942.69 ▼5.53
Posts /wp-admin/edit.php2,119 ▲272.34 ▲0.2841.52 ▼1.5634.93 ▼5.31
Add New Post /wp-admin/post-new.php6,272 ▲4,73926.25 ▲3.22887.71 ▲284.0236.43 ▼13.35
Media Library /wp-admin/upload.php1,429 ▲444.29 ▲0.0889.32 ▼12.5740.37 ▼3.21

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/trigger-warning-deluxe/views/common/posttitlewarning.php
    • > /wp-content/plugins/trigger-warning-deluxe/views/admin/twd-about.php
  • 18× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/trigger-warning-deluxe/views/admin/optionsfield-textarea.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/trigger-warning-deluxe/views/admin/twd-admin.php:4
    • > PHP Notice
      Undefined variable: values in wp-content/plugins/trigger-warning-deluxe/views/admin/optionsfield-radiobutton.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/trigger-warning-deluxe/plugin.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/trigger-warning-deluxe/admin-plugin.php:290
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/trigger-warning-deluxe/views/common/postwarning.php:1
    • > PHP Notice
      Undefined variable: warninglabel in wp-content/plugins/trigger-warning-deluxe/views/common/posttitlewarning.php on line 1
    • > PHP Notice
      Trying to get property 'has_trigger' of non-object in wp-content/plugins/trigger-warning-deluxe/views/admin/posttriggercolumn.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/trigger-warning-deluxe/views/admin/posttriggereditbox.php:3
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/trigger-warning-deluxe/views/admin/optionsfield-checkbox.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

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
4 plugin tags: trauma, trigger warning, content rating, sensitivity

trigger-warning-deluxe/plugin.php 92% from 13 tests

"Trigger Warning Deluxe" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("trigger-warning-deluxe.php" instead of "plugin.php")

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 plugin627 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP16142129528
CSS29066
JavaScript24033

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.30
Average class complexity7.43
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity1.79
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods64
▷ Static methods23.12%
▷ Public methods6195.31%
▷ Protected methods00.00%
▷ Private methods34.69%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.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
There were not PNG files found in your plugin