63% directedit

Code Review | DirectEdit

WordPress plugin DirectEdit scored 63% from 54 tests.

About plugin

  • Plugin page: directedit
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-3.9
  • WordPress version: 6.3.1
  • First release: Dec 10, 2013
  • Latest release: Aug 12, 2014
  • Number of updates: 28
  • Update frequency: every 8.8 days
  • Top authors: carloroosen (96.43%)pilotessa (7.14%)

Code review

54 tests

User reviews

7 reviews

Install metrics

20+ active / 4,449 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▼8.46ms] Passed 4 tests

This is a short check of server-side resources used by DirectEdit
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2429.36 ▼10.79
Dashboard /wp-admin3.61 ▲0.3050.32 ▲1.42
Posts /wp-admin/edit.php3.72 ▲0.3647.75 ▲2.30
Add New Post /wp-admin/post-new.php5.74 ▼0.1576.22 ▼24.64
Media Library /wp-admin/upload.php3.53 ▲0.3033.66 ▲0.16
Direct Edit /wp-admin/plugins.php?page=direct-edit3.5032.46

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for DirectEdit
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,446 ▲71116.31 ▲1.9353.84 ▲52.0947.98 ▲5.96
Dashboard /wp-admin2,207 ▲195.99 ▲0.0999.01 ▼6.5439.25 ▼1.10
Posts /wp-admin/edit.php2,093 ▲12.02 ▲0.0139.03 ▼1.9834.98 ▼0.63
Add New Post /wp-admin/post-new.php6,495 ▲4,95921.11 ▼2.11834.42 ▲193.8867.60 ▲11.30
Media Library /wp-admin/upload.php1,392 ▲44.22 ▲0.0096.67 ▲0.4542.58 ▼2.12
Direct Edit /wp-admin/plugins.php?page=direct-edit9481.8730.7941.95

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/directedit/direct-edit.php+474
    Undefined property: WP_Role::$ID
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% 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
Please take a closer look at the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'De_Item' not found in wp-content/plugins/directedit/core/classes/de-item-text.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_theme_support() in wp-content/plugins/directedit/core/handler.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/directedit/direct-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/directedit/direct-edit.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Donate link: Please fix this invalid URI: ""
The official readme.txt is a good inspiration

directedit/direct-edit.php 85% from 13 tests

The principal PHP file in "DirectEdit" v. 1.0.4 is loaded by WordPress automatically on each request
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 ("directedit.php" instead of "direct-edit.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 384 characters long)

Code Analysis 5% from 3 tests

File types 0% from 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
It is important to fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/directedit/js/minify.bat
8,477 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP116993964,022
JavaScript121182992,571
CSS22831831,720
JSON100163
DOS Batch1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity93.50
▷ Minimum class complexity1.00
▷ Maximum class complexity304.00
Average method complexity7.67
▷ Minimum method complexity1.00
▷ Maximum method complexity71.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods111
▷ Static methods2219.82%
▷ Public methods9585.59%
▷ Protected methods1614.41%
▷ Private methods00.00%
Functions65
▷ Named functions65100.00%
▷ Anonymous functions00.00%
Constants25
▷ Global constants25100.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
15 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
theme/images/select_style_right.png3.35KB3.02KB▼ 9.80%
theme/images/select_style_centered.png3.26KB2.96KB▼ 9.26%
theme/images/corner-tr.png0.13KB0.09KB▼ 32.09%
theme/images/select_style.png7.45KB5.68KB▼ 23.84%
theme/images/select_style_left.png3.39KB3.06KB▼ 9.49%