84% post-types-order

Code Review | Post Types Order

WordPress plugin Post Types Order scored84%from 54 tests.

About plugin

  • Plugin page: post-types-order
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 5, 2010
  • Latest release: Nov 9, 2023
  • Number of updates: 125
  • Update frequency: every 38.5 days
  • Top authors: nsp-code (100%)

Code review

54 tests

User reviews

282 reviews

Install metrics

600,000+ active /10,010,610 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.19MB] [CPU: ▼1.59ms] Passed 4 tests

An overview of server-side resources used by Post Types Order
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1639.19 ▲5.23
Dashboard /wp-admin3.51 ▲0.2047.12 ▼1.35
Posts /wp-admin/edit.php3.62 ▲0.2650.99 ▲0.67
Add New Post /wp-admin/post-new.php6.09 ▲0.2086.43 ▼10.91
Media Library /wp-admin/upload.php3.43 ▲0.2039.99 ▲6.20
Re-Order /wp-admin/upload.php?page=order-post-types-attachment3.4137.50
Re-Order /wp-admin/edit.php?page=order-post-types-post3.4336.73
Re-Order /wp-admin/edit.php?post_type=wp_navigation&page=order-post-types-wp_navigation3.4137.32
Post Types Order /wp-admin/options-general.php?page=cpto-options3.4032.77
Re-Order /wp-admin/edit.php?post_type=wp_block&page=order-post-types-wp_block3.4132.36

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Post Types Order
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲5114.00 ▼0.281.69 ▼0.0541.80 ▼0.73
Dashboard /wp-admin2,218 ▲415.72 ▲0.1392.65 ▼10.4073.56 ▲31.12
Posts /wp-admin/edit.php2,127 ▲241.95 ▲0.0139.53 ▼0.9133.28 ▼2.04
Add New Post /wp-admin/post-new.php1,699 ▲17321.85 ▼1.54748.18 ▲64.2956.10 ▼8.44
Media Library /wp-admin/upload.php1,420 ▲234.24 ▲0.0299.94 ▼2.2577.57 ▲34.65
Re-Order /wp-admin/upload.php?page=order-post-types-attachment8711.9231.4928.14
Re-Order /wp-admin/edit.php?page=order-post-types-post8831.9534.9027.21
Re-Order /wp-admin/edit.php?post_type=wp_navigation&page=order-post-types-wp_navigation8731.9035.4530.37
Post Types Order /wp-admin/options-general.php?page=cpto-options1,2242.1727.2431.25
Re-Order /wp-admin/edit.php?post_type=wp_block&page=order-post-types-wp_block8701.9130.4627.22

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/post-types-order/post-types-order.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 97% 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
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The ReOrder interface through which the sort can be created.), #2 (Sort can be managed within default WordPress post type interface.)
The official readme.txt might help

post-types-order/post-types-order.php Passed 13 tests

The primary PHP file in "Post Types Order" version 2.1.1 is used by WordPress to initiate all plugin functionality
93 characters long description:
Posts Order and Post Types Objects Order using a Drag and Drop Sortable javascript capability

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected1,196 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP9398130938
PO File14243118
JavaScript116149
SVG11033
CSS37031
JSON10027

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity23.62
▷ Minimum class complexity2.00
▷ Maximum class complexity107.00
Average method complexity5.31
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods42
▷ Static methods00.00%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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.16MB with 0.08MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png112.78KB54.43KB▼ 51.74%
screenshot-1.png50.19KB38.77KB▼ 22.74%
images/menu-icon.png3.75KB0.93KB▼ 75.20%