83% ptpl-post-block

Code Review | PTPL post block

WordPress plugin PTPL post block scored83%from 54 tests.

About plugin

  • Plugin page: ptpl-post-block
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.4
  • WordPress version: 6.3.1
  • First release: Dec 21, 2014
  • Latest release: Dec 25, 2014
  • Number of updates: 26
  • Update frequency: every 0.4 days
  • Top authors: Turuzyan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /886 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼0.62MB] [CPU: ▼13.19ms] Passed 4 tests

Server-side resources used by PTPL post block
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0637.54 ▼3.58
Dashboard /wp-admin3.38 ▲0.0751.75 ▲2.13
Posts /wp-admin/edit.php3.43 ▲0.0746.96 ▲6.09
Add New Post /wp-admin/post-new.php3.21 ▼2.6834.26 ▼52.69
Media Library /wp-admin/upload.php3.30 ▲0.0735.07 ▲1.39

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for PTPL post block
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7713.30 ▼1.101.68 ▼0.0343.75 ▲5.36
Dashboard /wp-admin2,228 ▲405.79 ▲0.9299.85 ▼17.0462.07 ▲16.11
Posts /wp-admin/edit.php2,111 ▲221.99 ▼0.0736.41 ▼2.1033.62 ▲2.41
Add New Post /wp-admin/post-new.php1,863 ▲33023.42 ▲0.07641.39 ▼42.9358.27 ▲0.10
Media Library /wp-admin/upload.php1,404 ▲164.21 ▼0.22113.60 ▲9.2342.35 ▼0.08

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ptpl-post-block/functions.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ptpl-post-block/functions.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ptpl-post-block/fields.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ptpl-post-block/settings.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% 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 need to be fixed:
  • License uri: Please fix this invalid url: ""
  • License: No value
  • Donate link: Please fix this invalid url: "gofundme.com/iwyfao"
You can take inspiration from this readme.txt

ptpl-post-block/index.php 85% from 13 tests

The main PHP file in "PTPL post block" ver. 1.1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ptpl-post-block.php" instead of "index.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 269 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin569 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP47242420
CSS242116
JavaScript14133

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.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
4 PNG files occupy 0.18MB with 0.10MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png53.70KB26.26KB▼ 51.09%
images/setting_icon.png1.30KB0.48KB▼ 63.47%
screenshot-3.png68.00KB35.41KB▼ 47.93%
screenshot-1.png59.90KB22.98KB▼ 61.64%