10% my-posts-order

Code Review | My Post Order

WordPress plugin My Post Order scored10%from 54 tests.

About plugin

  • Plugin page: my-posts-order
  • Plugin version: 1.2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5
  • WordPress version: 6.3.1
  • First release: Nov 8, 2011
  • Latest release: Jan 11, 2013
  • Number of updates: 27
  • Update frequency: every 16.1 days
  • Top authors: kapilchugh (92.59%)Otto42 (11.11%)

Code review

54 tests

User reviews

7 reviews

Install metrics

700+ active /60,246 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/my-posts-order/includes/widget.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; My_Posts_Order has a deprecated constructor

Server metrics [RAM: ▼1.69MB] [CPU: ▼45.52ms] Passed 4 tests

Analyzing server-side resources used by My Post Order
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.30 ▼1.178.71 ▼30.70
Dashboard /wp-admin2.31 ▼0.9910.93 ▼33.39
Posts /wp-admin/edit.php2.31 ▼1.0411.38 ▼31.27
Add New Post /wp-admin/post-new.php2.31 ▼3.5810.60 ▼86.72
Media Library /wp-admin/upload.php2.31 ▼0.928.68 ▼24.51

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 28 new files
Database: 1 new table, 7 new options
New tables
wp_sections
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_my_posts_order
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for My Post Order
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.29 ▼1.101.68 ▼0.1837.83 ▼9.97
Dashboard /wp-admin2,216 ▲245.84 ▲0.92100.77 ▼5.2538.97 ▼1.45
Posts /wp-admin/edit.php2,105 ▲162.00 ▲0.0136.62 ▼2.6734.06 ▼2.73
Add New Post /wp-admin/post-new.php1,551 ▲3123.46 ▲0.24658.43 ▲25.4549.70 ▼4.73
Media Library /wp-admin/upload.php1,407 ▲194.23 ▲0.0199.65 ▼6.4042.99 ▲0.70

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in My_Posts_Order is deprecated since version 4.3.0! Use __construct() instead.
  • Zombie tables detected upon uninstall: 1 table
    • wp_sections
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_my_posts_order
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/my-posts-order/includes/loop_rss.php
    • > /wp-content/plugins/my-posts-order/includes/delete_section_data.php
  • 27× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined index: content_type in wp-content/plugins/my-posts-order/includes/get_content_type.php on line 34
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/my-posts-order/includes/defines.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/my-posts-order/includes/show_posts.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/my-posts-order/includes/defines.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mpo_display_radio_buttons() in wp-content/plugins/my-posts-order/includes/select_criteria.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function check_ajax_referer() in wp-content/plugins/my-posts-order/includes/save_section_data.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/my-posts-order/includes/show_posts.php:5
    • > PHP Warning
      Creating default object from empty value in wp-content/plugins/my-posts-order/includes/db-schema.php on line 3
    • > PHP Notice
      Undefined variable: rss_items in wp-content/plugins/my-posts-order/includes/loop_rss.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Section' not found in wp-content/plugins/my-posts-order/includes/add_edit_criteria.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Add new section based on `select posts individually` criteria.), #2 (Add new section based on `category`.), #3 (Add new section based on `XML/RSS` criteria.), #4 (Selection of widget.), #5 (Posts display on site.)
You can take inspiration from this readme.txt

my-posts-order/my-posts-order.php Passed 13 tests

This is the main PHP file of "My Post Order" version 1.2.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
78 characters long description:
A plugin which allows you to sort posts, pages, custom post type in ANY order.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,636 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP17891141,009
JavaScript270192593
CSS12134

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.32
Average class complexity16.50
▷ Minimum class complexity12.00
▷ Maximum class complexity21.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
5 PNG files occupy 0.13MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png27.51KB11.38KB▼ 58.63%
screenshot-1.png45.72KB18.02KB▼ 60.60%
screenshot-5.png0.92KB0.49KB▼ 46.75%
screenshot-4.png11.72KB5.15KB▼ 56.04%
screenshot-2.png43.86KB16.79KB▼ 61.72%