10% last-posts-category-and-post-types

Code Review | Last Posts Category and Post Types

WordPress plugin Last Posts Category and Post Types scored10%from 54 tests.

About plugin

  • Plugin page: last-posts-catego...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.9
  • WordPress version: 6.3.1
  • First release: May 15, 2014
  • Latest release: May 16, 2014
  • Number of updates: 23
  • Update frequency: every 0.0 days
  • Top authors: sinan-isler (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /6,028 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/last-posts-category-and-post-types/index.php+101
    Function create_function() is deprecated

Server metrics [RAM: ▼1.93MB] [CPU: ▼61.81ms] Passed 4 tests

This is a short check of server-side resources used by Last Posts Category and Post Types
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.405.96 ▼39.98
Dashboard /wp-admin2.08 ▼1.268.12 ▼66.47
Posts /wp-admin/edit.php2.09 ▼1.275.48 ▼43.86
Add New Post /wp-admin/post-new.php2.08 ▼3.806.18 ▼96.91
Media Library /wp-admin/upload.php2.08 ▼1.145.84 ▼33.18

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

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

Browser metrics Passed 4 tests

Last Posts Category and Post Types: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.72 ▲0.091.83 ▼0.0744.87 ▼5.70
Dashboard /wp-admin2,198 ▲245.63 ▲0.1184.73 ▼14.1338.81 ▼7.50
Posts /wp-admin/edit.php2,097 ▼31.98 ▼0.0337.38 ▲0.6634.47 ▼7.19
Add New Post /wp-admin/post-new.php1,526 ▼023.31 ▲0.21648.98 ▼21.3052.33 ▼1.80
Media Library /wp-admin/upload.php1,400 ▼04.19 ▲0.0499.79 ▼3.1743.36 ▼5.29

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/last-posts-category-and-post-types/index.php+101
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_categoryandpoststypes

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/last-posts-category-and-post-types/index.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention: You can take inspiration from this readme.txt

last-posts-category-and-post-types/index.php 85% from 13 tests

The principal PHP file in "Last Posts Category and Post Types" v. 0.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("last-posts-category-and-post-types.php" instead of "index.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 202 characters long)

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 detected67 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP131867

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.04
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.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%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png11.29KB4.64KB▼ 58.86%