84% a-tiny-post-content-template-interpreter

Code Review | A Tiny Post Content Template Interpreter

WordPress plugin A Tiny Post Content Template Interpreter scored84%from 54 tests.

About plugin

  • Plugin page: a-tiny-post-conte...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.2
  • WordPress version: 6.3.1
  • First release: Jul 17, 2015
  • Latest release: Nov 30, 2015
  • Number of updates: 11
  • Update frequency: every 12.5 days
  • Top authors: Magenta Cuda (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,025 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼3.18ms] Passed 4 tests

An overview of server-side resources used by A Tiny Post Content Template Interpreter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2343.03 ▼0.68
Dashboard /wp-admin3.55 ▲0.2053.88 ▼6.54
Posts /wp-admin/edit.php3.66 ▲0.3154.16 ▲4.71
Add New Post /wp-admin/post-new.php6.16 ▲0.2795.25 ▼10.20
Media Library /wp-admin/upload.php3.47 ▲0.2440.87 ▲8.95
Post Content Templates /wp-admin/edit.php?post_type=mt_content_template3.5643.68
A Tiny Post Content Template Interpreter /wp-admin/options-general.php?page=tpcti-settings-page3.4432.63
Add New /wp-admin/post-new.php?post_type=mt_content_template3.5952.27

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for A Tiny Post Content Template Interpreter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.24 ▼1.191.66 ▼0.1441.11 ▼0.30
Dashboard /wp-admin2,237 ▲495.88 ▲0.97102.78 ▼9.8639.88 ▲1.01
Posts /wp-admin/edit.php2,123 ▲312.15 ▲0.1539.50 ▲3.5735.23 ▲0.62
Add New Post /wp-admin/post-new.php1,676 ▲15717.65 ▼5.70655.89 ▼0.2354.66 ▼4.95
Media Library /wp-admin/upload.php1,416 ▲254.20 ▼0.01109.33 ▲8.2946.50 ▲5.09
Post Content Templates /wp-admin/edit.php?post_type=mt_content_template1,6252.0332.4333.44
A Tiny Post Content Template Interpreter /wp-admin/options-general.php?page=tpcti-settings-page9212.0625.5125.37
Add New /wp-admin/post-new.php?post_type=mt_content_template2,3137.61174.4559.45

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/a-tiny-post-content-template-interpreter/magic-fields-2-dumb-macros.php on line 45
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/a-tiny-post-content-template-interpreter/magic-fields-2-dumb-macros.php on line 45
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/a-tiny-post-content-template-interpreter/magic-fields-2-dumb-macros.php on line 45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/a-tiny-post-content-template-interpreter/magic-fields-2-dumb-macros.php:60
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/a-tiny-post-content-template-interpreter/tiny-post-content-template-interpreter-loader.php:47

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid URI ("")
The official readme.txt might help

a-tiny-post-content-template-interpreter/tiny-post-content-template-interpreter-loader.php 92% from 13 tests

This is the main PHP file of "A Tiny Post Content Template Interpreter" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("a-tiny-post-content-template-interpreter.php" instead of "tiny-post-content-template-interpreter-loader.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected1,572 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP31342541,368
JavaScript1531118
CSS15286

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.58
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
Namespaces3
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%
Functions42
▷ Named functions716.67%
▷ Anonymous functions3583.33%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.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
No PNG images were found in this plugin