74% content-template-engine

Code Review | Content Template Engine

WordPress plugin Content Template Engine scored 74% from 54 tests.

About plugin

  • Plugin page: content-template-...
  • Plugin version: 0.9.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.5
  • WordPress version: 6.3.1
  • First release: Sep 5, 2015
  • Latest release: Apr 21, 2016
  • Number of updates: 22
  • Update frequency: every 10.4 days
  • Top authors: miyauchi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,775 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼1.23MB] [CPU: ▼43.21ms] Passed 4 tests

An overview of server-side resources used by Content Template Engine
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.74 ▼0.7213.88 ▼28.07
Dashboard /wp-admin2.78 ▼0.5214.31 ▼33.29
Posts /wp-admin/edit.php2.78 ▼0.5715.75 ▼29.65
Add New Post /wp-admin/post-new.php2.78 ▼3.1014.75 ▼81.82
Media Library /wp-admin/upload.php2.78 ▼0.4513.27 ▼19.33

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 622 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Content Template Engine
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.20 ▼1.171.86 ▼0.3443.58 ▼7.85
Dashboard /wp-admin2,209 ▲185.90 ▲0.8799.32 ▼10.7839.38 ▼4.58
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0333.57 ▼3.8730.92 ▼3.70
Add New Post /wp-admin/post-new.php6,482 ▲4,94920.40 ▼2.95913.60 ▲231.4856.54 ▼24.98
Media Library /wp-admin/upload.php1,388 ▼04.20 ▼0.0394.13 ▼15.5639.92 ▼5.64

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-content/plugins/content-template-engine/vendor/twig/twig/lib/Twig/Loader/String.php+12
    The Twig_Loader_String class is deprecated since version 1.18.1 and will be removed in 2.0. Use Twig_Loader_Array instead or Twig_Environment::createTemplate().
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 218× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Error' not found in wp-content/plugins/content-template-engine/vendor/twig/twig/lib/Twig/Error/Syntax.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/content-template-engine/content-template-engine.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Unary' not found in wp-content/plugins/content-template-engine/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/content-template-engine/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Test_NodeTestCase' not found in wp-content/plugins/content-template-engine/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/ModTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/content-template-engine/vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Call' not found in wp-content/plugins/content-template-engine/vendor/twig/twig/lib/Twig/Node/Expression/Function.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Test_NodeTestCase' not found in wp-content/plugins/content-template-engine/vendor/twig/twig/test/Twig/Tests/Node/Expression/ConditionalTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/content-template-engine/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/content-template-engine/vendor/twig/twig/test/Twig/Tests/LexerTest.php:11

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 Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: the_content, template engine, template, post, page...

content-template-engine/content-template-engine.php Passed 13 tests

The main PHP file in "Content Template Engine" ver. 0.9.4 adds more information about the plugin and also serves as the entry point for this plugin
55 characters long description:
Enables Twig template engine in the WordPress contents.

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
No dangerous file extensions were detected18,072 lines of code in 369 files:
LanguageFilesBlank linesComment linesLines of code
PHP2633,1446,50713,864
reStructuredText782,2371,9543,107
C1161174792
JSON300168
Markdown114037
PO File1122130
XML12023
HTML110017
C/C++ Header171315
Twig86014
m41215

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity5.64
▷ Minimum class complexity1.00
▷ Maximum class complexity119.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces2
Interfaces20
Traits0
Classes260
▷ Abstract classes145.38%
▷ Concrete classes24694.62%
▷ Final classes00.00%
Methods1,222
▷ Static methods110.90%
▷ Public methods1,08388.63%
▷ Protected methods12310.07%
▷ Private methods161.31%
Functions66
▷ Named functions5786.36%
▷ Anonymous functions913.64%
Constants44
▷ Global constants12.27%
▷ Class constants4397.73%
▷ Public constants43100.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
There are no PNG files in this plugin