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

Code Review | A Tiny Post Content Template Interpreter

WordPress plugin A Tiny Post Content Template Interpreter scored 94% 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: 5.8.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 / 859 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.23MB] [CPU: ▼149.80ms] Passed 4 tests

Analyzing server-side resources used by A Tiny Post Content Template Interpreter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.06 ▲0.2228.09 ▲7.40
Dashboard /wp-admin3.30 ▲0.2433.55 ▼1.65
Posts /wp-admin/edit.php3.41 ▲0.3031.93 ▼3.18
Add New Post /wp-admin/post-new.php5.67 ▲0.2370.85 ▼596.42
Media Library /wp-admin/upload.php3.24 ▲0.2424.56 ▲2.07
Add New /wp-admin/post-new.php?post_type=mt_content_template3.3638.43
Post Content Templates /wp-admin/edit.php?post_type=mt_content_template3.3327.21
A Tiny Post Content Template Interpreter /wp-admin/options-general.php?page=tpcti-settings-page3.2121.80

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by A Tiny Post Content Template Interpreter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,718 ▲11715.89 ▲0.237.08 ▼1.4775.89 ▲1.72
Dashboard /wp-admin2,970 ▲746.03 ▼0.15116.28 ▼16.47162.74 ▼7.68
Posts /wp-admin/edit.php2,783 ▲463.24 ▲0.0263.41 ▲0.07138.39 ▼1.71
Add New Post /wp-admin/post-new.php2,652 ▼1,15515.94 ▼3.16397.03 ▼23.53154.73 ▼7.63
Media Library /wp-admin/upload.php1,793 ▲415.48 ▼0.03140.15 ▼6.43186.80 ▲6.12
Add New /wp-admin/post-new.php?post_type=mt_content_template3,08910.03190.37204.91
Post Content Templates /wp-admin/edit.php?post_type=mt_content_template2,1623.2160.88133.95
A Tiny Post Content Template Interpreter /wp-admin/options-general.php?page=tpcti-settings-page1,2132.4153.52113.15

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > 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 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 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 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 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid URI ("")
Please take inspiration from this readme.txt

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

Analyzing the main PHP file in "A Tiny Post Content Template Interpreter" version 1.2
It is important to fix the following:
  • Main file name: The principal plugin file should be the same 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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
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
No complexity issues detected
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

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin