77% website-builder

Code Review | Draft - Add Tailwind CSS to WordPress

WordPress plugin Draft - Add Tailwind CSS to WordPress scored77%from 54 tests.

About plugin

  • Plugin page: website-builder
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Aug 9, 2021
  • Latest release: Oct 13, 2022
  • Number of updates: 11
  • Update frequency: every 39.5 days
  • Top authors: leeshadle (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /1,632 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.36ms] Passed 4 tests

An overview of server-side resources used by Draft - Add Tailwind CSS to WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.10 ▼3.92
Dashboard /wp-admin3.33 ▲0.0250.53 ▼0.49
Posts /wp-admin/edit.php3.38 ▲0.0249.99 ▼5.48
Add New Post /wp-admin/post-new.php5.92 ▲0.0397.09 ▲4.46
Media Library /wp-admin/upload.php3.25 ▲0.0241.76 ▲4.78
Draft /wp-admin/options-general.php?page=draft-settings3.2536.90

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
draft_settings
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Draft - Add Tailwind CSS to WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /373 ▼2,3888.02 ▼6.59256.22 ▲253.9443.56 ▲0.64
Dashboard /wp-admin2,197 ▲235.59 ▲0.0293.88 ▼5.9942.93 ▲3.62
Posts /wp-admin/edit.php2,102 ▲21.99 ▼0.1239.70 ▲0.6935.64 ▲1.48
Add New Post /wp-admin/post-new.php1,622 ▲9627.65 ▲4.38983.98 ▲292.6338.16 ▼14.24
Media Library /wp-admin/upload.php1,408 ▲84.18 ▼0.02105.74 ▼2.7148.45 ▲2.71
Draft /wp-admin/options-general.php?page=draft-settings1,51728.40897.1194.30

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • draft_settings
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WebsiteBuilder\\plugin_basename() in wp-content/plugins/website-builder/website-builder.php:30

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=draft-settings
    • > Console-api (warning) in wp-content/plugins/website-builder/build/tailwind.cdn.js?ver=2.0.0+63:1268
    cdn.tailwindcss.com should not be used in production. To use Tailwind CSS in production, install it as a PostCSS plugin or use the Tailwind CLI: https://tailwindcss.com/docs/installation
    • > GET request to /wp-admin/options-general.php?page=draft-settings
    • > Console-api (warning) in wp-content/plugins/website-builder/build/tailwind.cdn.js?ver=2.0.0+0:20775
    • > GET request to /wp-admin/options-general.php?page=draft-settings
    • > Console-api (warning) in wp-content/plugins/website-builder/build/tailwind.cdn.js?ver=2.0.0+0:20805
    warn" "-" "No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.
    • > GET request to /wp-admin/options-general.php?page=draft-settings
    • > Console-api (warning) in wp-content/plugins/website-builder/build/tailwind.cdn.js?ver=2.0.0+0:20805
    warn" "-" "https://tailwindcss.com/docs/content-configuration

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can take inspiration from this readme.txt

website-builder/website-builder.php 69% from 13 tests

The primary PHP file in "Draft - Add Tailwind CSS to WordPress" version 2.0.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Requires PHP: The required version number did not match the one declared in readme.txt ("7.0.0" instead of "5.6")
  • 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
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.3.2" instead of "5.0")
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected542 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP9119333490
JavaScript381049
CSS3103

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity6.14
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods828.57%
▷ Public methods28100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected