84% wpct-drag-drop-recent-posts

Code Review | WPCT Drag & Drop Recent Posts

WordPress plugin WPCT Drag & Drop Recent Posts scored84%from 54 tests.

About plugin

  • Plugin page: wpct-drag-drop-re...
  • Plugin version: 1.11
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Nov 27, 2019
  • Latest release: Dec 27, 2019
  • Number of updates: 18
  • Update frequency: every 1.7 days
  • Top authors: wpcodetips (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /608 total downloads

Benchmarks

Plugin footprint 83% 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.16MB] [CPU: ▼4.61ms] Passed 4 tests

An overview of server-side resources used by WPCT Drag & Drop Recent Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1645.13 ▲5.18
Dashboard /wp-admin3.46 ▲0.1547.72 ▼3.99
Posts /wp-admin/edit.php3.51 ▲0.1547.00 ▼10.92
Add New Post /wp-admin/post-new.php6.06 ▲0.1793.30 ▼2.10
Media Library /wp-admin/upload.php3.38 ▲0.1534.99 ▼1.41

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_wpctrecentposts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for WPCT Drag & Drop Recent Posts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲14613.57 ▼0.7112.94 ▲11.2942.17 ▼2.70
Dashboard /wp-admin2,199 ▲195.56 ▼0.1282.78 ▼14.8839.57 ▼4.10
Posts /wp-admin/edit.php2,111 ▲112.19 ▲0.2237.08 ▲1.7431.69 ▼4.77
Add New Post /wp-admin/post-new.php1,539 ▲425.02 ▲6.80622.05 ▼22.7651.70 ▼30.34
Media Library /wp-admin/upload.php1,404 ▲44.17 ▼0.0195.32 ▼1.5440.47 ▼2.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
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_wpctrecentposts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wpct-drag-drop-recent-posts/wpct-drag-drop-recent-posts.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: posts widget, latest posts, latest posts widget, category posts, posts slider

wpct-drag-drop-recent-posts/wpct-drag-drop-recent-posts.php Passed 13 tests

The main file in "WPCT Drag & Drop Recent Posts" v. 1.11 serves as a complement to information provided in readme.txt and as the entry point to the plugin
34 characters long description:
Very customizable slider for posts

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected16,903 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
SVG30128,889
CSS52,538197,199
PHP12424787
JavaScript211628

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 108)
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity120.00
▷ Minimum class complexity120.00
▷ Maximum class complexity120.00
Average method complexity30.75
▷ Minimum method complexity1.00
▷ Maximum method complexity108.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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