62% twigify

Code Review | Twigify

WordPress plugin Twigify scored62%from 54 tests.

About plugin

  • Plugin page: twigify
  • Plugin version: 1.1.2-beta...
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Dec 12, 2014
  • Latest release: Feb 16, 2015
  • Number of updates: 15
  • Update frequency: every 5.6 days
  • Top authors: mpvanwinkle77 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /834 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼1.22MB] [CPU: ▼46.04ms] Passed 4 tests

An overview of server-side resources used by Twigify
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.76 ▼0.7011.88 ▼28.42
Dashboard /wp-admin2.80 ▼0.5515.94 ▼44.39
Posts /wp-admin/edit.php2.80 ▼0.5616.14 ▼33.15
Add New Post /wp-admin/post-new.php2.80 ▼3.0916.93 ▼78.21
Media Library /wp-admin/upload.php2.80 ▼0.4316.05 ▼15.89
Templates /wp-admin/edit.php?post_type=ctemplates2.8016.04
Settings /wp-admin/admin.php?page=twigify-settings2.8015.39

Server storage [IO: ▲1.45MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Twigify: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,996 ▲25014.75 ▲0.352.02 ▲0.1537.45 ▼5.31
Dashboard /wp-admin2,374 ▲1896.58 ▲1.51134.22 ▲18.0837.79 ▼10.16
Posts /wp-admin/edit.php2,282 ▲1933.32 ▲1.3250.49 ▲13.0130.21 ▼6.60
Add New Post /wp-admin/post-new.php6,294 ▲4,76125.83 ▲2.48901.27 ▲245.6547.68 ▲0.39
Media Library /wp-admin/upload.php1,419 ▲374.09 ▼0.1876.99 ▼27.7439.93 ▼3.19
Templates /wp-admin/edit.php?post_type=ctemplates1,2473.2646.6227.68
Settings /wp-admin/admin.php?page=twigify-settings1,0452.9842.2925.38

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/twigify/lib/ContentTemplates/Settings.php+37
    Undefined index: roles
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=twigify-settings
    • > Notice in wp-content/plugins/twigify/lib/ContentTemplates/Settings.php+37
    Undefined index: roles
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=twigify-settings
    • > Warning in wp-content/plugins/twigify/vendor/Custom-Metaboxes-and-Fields-for-WordPress-master/init.php+745
    count(): Parameter must be an array or an object that implements Countable
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=twigify-settings
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=twigify-settings
    • > Notice in wp-content/plugins/twigify/lib/ContentTemplates/AdminBar.php+8
    Undefined index: post

SRP 0% 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
Please fix the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/twigify/views/alert.html.php
    • > /wp-content/plugins/twigify/views/settings.html.php
    • > /wp-content/plugins/twigify/vendor/Custom-Metaboxes-and-Fields-for-WordPress-master/tests/phpunit/includes/bootstrap.php
    • > /wp-content/plugins/twigify/views/form.html.php
  • 189× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Test' not found in wp-content/plugins/twigify/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Error' not found in wp-content/plugins/twigify/vendor/twig/twig/lib/Twig/Error/Runtime.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression' not found in wp-content/plugins/twigify/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/twigify/vendor/mockery/mockery/examples/starship/StarshipTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Mockery\\Matcher\\MatcherAbstract' not found in wp-content/plugins/twigify/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Mockery\\Matcher\\MatcherAbstract' not found in wp-content/plugins/twigify/vendor/mockery/mockery/library/Mockery/Matcher/Not.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/twigify/vendor/twig/twig/lib/Twig/Node/Set.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Mock\\Hook' not found in wp-content/plugins/twigify/vendor/10up/wp_mock/WP_Mock/Action.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/twigify/vendor/twig/twig/lib/Twig/Node/Flush.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/twigify/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: content, layout, twig, templating

twigify/twigify.php 85% from 13 tests

"Twigify" version 1.1.2-beta...'s primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Domain Path: The domain path folder does not exist ("/lang")
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "1.1.2-beta...")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected25,584 lines of code in 458 files:
LanguageFilesBlank linesComment linesLines of code
PHP3003,8179,09516,517
reStructuredText1162,6942,4963,796
JavaScript53124032,246
C1166150793
Markdown92000559
CSS26121540
JSON700365
XML521276
Bourne Shell35245201
make1286143
YAML614094
Python16815338
C/C++ Header171311
m41215

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity7.76
▷ Minimum class complexity1.00
▷ Maximum class complexity137.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces23
Interfaces25
Traits0
Classes265
▷ Abstract classes186.79%
▷ Concrete classes24793.21%
▷ Final classes00.00%
Methods1,503
▷ Static methods1389.18%
▷ Public methods1,34689.55%
▷ Protected methods1308.65%
▷ Private methods271.80%
Functions169
▷ Named functions13479.29%
▷ Anonymous functions3520.71%
Constants69
▷ Global constants1420.29%
▷ Class constants5579.71%
▷ Public constants55100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/Custom-Metaboxes-and-Fields-for-WordPress-master/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vendor/Custom-Metaboxes-and-Fields-for-WordPress-master/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
vendor/Custom-Metaboxes-and-Fields-for-WordPress-master/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
vendor/Custom-Metaboxes-and-Fields-for-WordPress-master/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
vendor/Custom-Metaboxes-and-Fields-for-WordPress-master/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%