83% drag-drop-featured-image-improved

Code Review | Drag & Drop Featured Image Improved

WordPress plugin Drag & Drop Featured Image Improved scored83%from 54 tests.

About plugin

  • Plugin page: drag-drop-feature...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 16, 2023
  • Latest release: Apr 4, 2023
  • Number of updates: 6
  • Update frequency: every 8.3 days
  • Top authors: wpgenie2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /197 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.30ms] Passed 4 tests

Analyzing server-side resources used by Drag & Drop Featured Image Improved
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0941.35 ▼7.58
Dashboard /wp-admin3.38 ▲0.0773.16 ▲13.76
Posts /wp-admin/edit.php3.49 ▲0.1351.86 ▲0.90
Add New Post /wp-admin/post-new.php5.99 ▲0.1091.69 ▼10.15
Media Library /wp-admin/upload.php3.30 ▲0.0737.35 ▼0.37
Featured Image /wp-admin/options-general.php?page=drag-drop-featured-image-improved3.2934.18

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
drag-drop-user-capability
drag-drop-file-types
theysaidso_admin_options
can_compress_scripts
drag-drop-page-reload
db_upgraded
drag-drop-post-types
widget_recent-comments

Browser metrics Passed 4 tests

Drag & Drop Featured Image Improved: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.39 ▲0.211.91 ▼0.5042.29 ▼0.87
Dashboard /wp-admin2,199 ▲225.57 ▼0.0183.73 ▼16.5238.46 ▼4.26
Posts /wp-admin/edit.php2,104 ▲11.97 ▼0.0037.96 ▼1.5734.11 ▼1.62
Add New Post /wp-admin/post-new.php6,319 ▲4,79118.94 ▼4.35984.40 ▲359.4282.77 ▲28.67
Media Library /wp-admin/upload.php1,404 ▲14.14 ▲0.0196.26 ▼18.2643.71 ▼1.48
Featured Image /wp-admin/options-general.php?page=drag-drop-featured-image-improved9342.0326.0135.85

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 10 options
    • drag-drop-file-types
    • theysaidso_admin_options
    • can_compress_scripts
    • drag-drop-post-types
    • widget_recent-posts
    • drag-drop-page-reload
    • widget_theysaidso_widget
    • drag-drop-user-capability
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_option() in wp-content/plugins/drag-drop-featured-image-improved/index.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/drag-drop-featured-image-improved/assets/views/options.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: image, metabox, replacement, upload, featured image

drag-drop-featured-image-improved/index.php 77% from 13 tests

"Drag & Drop Featured Image Improved" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("drag-drop-featured-image-improved.php" instead of "index.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 142 characters long)

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
There were no executable files found in this plugin585 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP2176150412
CSS223096
JavaScript1292577

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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.40MB with 0.27MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png240.62KB73.84KB▼ 69.31%
screenshot-3.png95.56KB31.06KB▼ 67.50%
screenshot-1.png69.80KB23.46KB▼ 66.39%