10% hide-posts-without-post-title

Code Review | Hide posts without post title

WordPress plugin Hide posts without post title scored10%from 54 tests.

About plugin

  • Plugin page: hide-posts-withou...
  • Plugin version: 1.0.6.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.8.3
  • WordPress version: 6.3.1
  • First release: Dec 8, 2019
  • Latest release: Jan 21, 2022
  • Number of updates: 7
  • Update frequency: every 112.3 days
  • Top authors: mjkhajeh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /529 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Error in wp-content/plugins/hide-posts-without-post-title/hpwpt.php+42
    Uncaught Error: Class 'hpwpt\Utils' not found in wp-content/plugins/hide-posts-without-post-title/hpwpt.php:42
    Stack trace:
    #0 wp-content/plugins/hide-posts-without-post-title/hpwpt.php(27): hpwpt\Init->__construct()
    #1 wp-content/plugins/hide-posts-without-post-title/hpwpt.php(195): hpwpt\Init::get_instance()
    #2 wp-admin/includes/plugin.php(2318): include_once('/var/www/wordpr...')
    #3 wp-admin/includes/plugin.php(663): plugin_sandbox_scrape()

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.50ms] Passed 4 tests

Server-side resources used by Hide posts without post title
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.32 ▼3.49
Dashboard /wp-admin3.31 ▲0.0047.84 ▼14.88
Posts /wp-admin/edit.php3.36 ▲0.0047.45 ▼4.62
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.63 ▼11.02
Media Library /wp-admin/upload.php3.23 ▲0.0037.85 ▼0.29

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Hide posts without post title
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.27 ▼0.081.98 ▼0.1940.25 ▼2.77
Dashboard /wp-admin2,192 ▲185.52 ▼0.0685.11 ▼7.6339.18 ▼3.76
Posts /wp-admin/edit.php2,103 ▲61.99 ▼0.0038.65 ▼1.1037.41 ▼1.55
Add New Post /wp-admin/post-new.php1,526 ▼223.02 ▲0.04688.63 ▼7.1652.94 ▼0.36
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.04102.04 ▼13.1844.47 ▼4.06

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function hpwpt\\Admin\\add_action() in wp-content/plugins/hide-posts-without-post-title/Admin/MetaBox.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function hpwpt\\Admin\\add_action() in wp-content/plugins/hide-posts-without-post-title/Admin/Settings.php:22

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
The official readme.txt is a good inspiration

hide-posts-without-post-title/hpwpt.php 85% from 13 tests

"Hide posts without post title" version 1.0.6.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("hide-posts-without-post-title.php" instead of "hpwpt.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

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected472 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP45281416
PO File1172156

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.77
Average class complexity24.50
▷ Minimum class complexity15.00
▷ Maximum class complexity44.00
Average method complexity5.70
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods20
▷ Static methods630.00%
▷ Public methods1785.00%
▷ Protected methods00.00%
▷ Private methods315.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin