77% directiq-wp

Code Review | DirectIQ Email Marketing

WordPress plugin DirectIQ Email Marketing scored77%from 54 tests.

About plugin

  • Plugin page: directiq-wp
  • Plugin version: 2.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.9
  • WordPress version: 6.3.1
  • First release: Aug 1, 2019
  • Latest release: Feb 10, 2022
  • Number of updates: 45
  • Update frequency: every 20.6 days
  • Top authors: directiq (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,755 total downloads

Benchmarks

Plugin footprint 82% 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: ▲0.17MB] [CPU: ▲0.22ms] 75% from 4 tests

A check of server-side resources used by DirectIQ Email Marketing
It is recommended to improve the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 860.30ms on /wp-admin/admin.php?page=directiq)
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1937.13 ▼5.19
Dashboard /wp-admin3.48 ▲0.1746.90 ▼0.91
Posts /wp-admin/edit.php3.59 ▲0.2349.90 ▲3.73
Add New Post /wp-admin/post-new.php6.06 ▲0.1788.72 ▲3.24
Media Library /wp-admin/upload.php3.40 ▲0.1738.27 ▲6.83
General Setup /wp-admin/admin.php?page=directiq3.40860.30

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 619 new files
Database: 1 new table, 11 new options
New tables
wp_diq_forms
New WordPress options
widget_theysaidso_widget
diq_recheck_authorize
theysaidso_admin_options
db_upgraded
can_compress_scripts
sc_style
response_status
diq_rest_key
sc_redirect_url
widget_recent-posts
...

Browser metrics Passed 4 tests

A check of browser resources used by DirectIQ Email Marketing
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,046 ▲30014.09 ▼0.3711.26 ▲9.5343.24 ▼8.21
Dashboard /wp-admin2,231 ▲435.87 ▲0.98109.89 ▼7.4877.39 ▲33.15
Posts /wp-admin/edit.php2,120 ▲521.99 ▼0.0339.38 ▲3.7535.60 ▲1.67
Add New Post /wp-admin/post-new.php1,536 ▲2217.55 ▲0.05747.83 ▲48.3959.10 ▲0.66
Media Library /wp-admin/upload.php1,404 ▲194.16 ▼0.05101.66 ▼3.7681.77 ▲35.04
General Setup /wp-admin/admin.php?page=directiq9951.8426.2746.84

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
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • diq_recheck_authorize
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/directiq-wp/css/admin.php
    • > /wp-content/plugins/directiq-wp/template/sidebar.php
    • > /wp-content/plugins/directiq-wp/css/front.php
  • 29× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant DIRECTIQ_PLUGIN_DIR_URL - assumed 'DIRECTIQ_PLUGIN_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/directiq-wp/template/sidebar.php on line 7
    • > PHP Notice
      Undefined variable: modal_close_btn in wp-content/plugins/directiq-wp/template/fields.php on line 25
    • > PHP Warning
      Use of undefined constant DIRECTIQ_PLUGIN_DIR_URL - assumed 'DIRECTIQ_PLUGIN_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/directiq-wp/template/header.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/directiq-wp/template/header.php:3
    • > PHP Notice
      Undefined variable: field_shortcode in wp-content/plugins/directiq-wp/template/static_fields.php on line 42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/directiq-wp/template/header.php:3
    • > PHP Notice
      Undefined variable: modal_form_id in wp-content/plugins/directiq-wp/template/fields.php on line 30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/directiq-wp/template/header.php:3
    • > PHP Notice
      Undefined variable: modal_input_field_type in wp-content/plugins/directiq-wp/template/fields.php on line 30
    • > PHP Notice
      Undefined variable: field_shortcode in wp-content/plugins/directiq-wp/template/static_fields.php on line 1

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Contributors: Contributors not specified
You can take inspiration from this readme.txt

directiq-wp/directiq.php 85% from 13 tests

The principal PHP file in "DirectIQ Email Marketing" v. 2.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("directiq-wp.php" instead of "directiq.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected112,663 lines of code in 603 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript3188,0776,72671,112
HTML1843,9671123,725
CSS822,80951314,047
PHP132742532,386
Markdown388901,322
JSON10047
SVG10019
Bourne Shell1015

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity48.00
▷ Minimum class complexity15.00
▷ Maximum class complexity81.00
Average method complexity3.76
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods34
▷ Static methods2161.76%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
codemirror/doc/logo.png9.09KB4.10KB▼ 54.95%
images/logo.png0.97KB0.71KB▼ 26.81%
codemirror/doc/yinyang.png4.52KB2.03KB▼ 55.19%
images/new_logo.png0.79KB0.59KB▼ 25.15%