74% theme-yaml

Code Review | Theme YAML - Use YAML instead JSON for your theme.json settings and styles

WordPress plugin Theme YAML - Use YAML instead JSON for your theme.json settings and styles scored74%from 54 tests.

About plugin

  • Plugin page: theme-yaml
  • Plugin version: 1.3.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 17, 2022
  • Latest release: Sep 22, 2023
  • Number of updates: 9
  • Update frequency: every 61.6 days
  • Top authors: landwire (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /591 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.87MB] [CPU: ▼62.85ms] Passed 4 tests

Server-side resources used by Theme YAML - Use YAML instead JSON for your theme.json settings and styles
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.12 ▼1.345.15 ▼38.01
Dashboard /wp-admin2.14 ▼1.208.06 ▼74.32
Posts /wp-admin/edit.php2.15 ▼1.216.17 ▼43.31
Add New Post /wp-admin/post-new.php2.15 ▼3.745.81 ▼95.74
Media Library /wp-admin/upload.php2.15 ▼1.087.29 ▼26.69

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 46 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Theme YAML - Use YAML instead JSON for your theme.json settings and styles
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.66 ▼0.651.72 ▼0.2538.56 ▼4.44
Dashboard /wp-admin2,205 ▲175.82 ▼0.0398.54 ▼20.2770.48 ▲27.88
Posts /wp-admin/edit.php2,086 ▼31.96 ▼0.0439.88 ▲4.8335.56 ▲3.06
Add New Post /wp-admin/post-new.php1,538 ▲2422.81 ▲5.25644.72 ▲2.9365.32 ▼3.24
Media Library /wp-admin/upload.php1,388 ▼04.17 ▲0.0797.22 ▼3.7246.94 ▲3.84

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > User error in wp-content/plugins/theme-yaml/lib/composer/platform_check.php+24
    Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.16.
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • 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)
Even though everything seems fine, this is not 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
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Yaml\\Exception\\ExceptionInterface' not found in wp-content/plugins/theme-yaml/lib/symfony/yaml/Exception/RuntimeException.php:19
    • > PHP Fatal error
      Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.16. in wp-content/plugins/theme-yaml/lib/composer/platform_check.php on line 24
    • > PHP Fatal error
      Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.4.16. in wp-content/plugins/theme-yaml/lib/composer/platform_check.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Yaml\\Exception\\RuntimeException' not found in wp-content/plugins/theme-yaml/lib/symfony/yaml/Exception/DumpException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Command\\Command' not found in wp-content/plugins/theme-yaml/lib/symfony/yaml/Command/LintCommand.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Yaml\\Exception\\RuntimeException' not found in wp-content/plugins/theme-yaml/lib/symfony/yaml/Exception/ParseException.php:19

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 96% from 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
5 plugin tags: themejson, theme, settings, yaml, styles

theme-yaml/theme-yaml.php 92% from 13 tests

This is the main PHP file of "Theme YAML - Use YAML instead JSON for your theme.json settings and styles" version 1.3.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin3,646 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP317341,1703,082
JSON400357
Markdown5860207

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 130)
Cyclomatic complexity
Average complexity per logical line of code0.69
Average class complexity42.83
▷ Minimum class complexity1.00
▷ Maximum class complexity299.00
Average method complexity6.66
▷ Minimum method complexity1.00
▷ Maximum method complexity130.00
Code structure
Namespaces8
Interfaces1
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes211.76%
Methods139
▷ Static methods5741.01%
▷ Public methods8561.15%
▷ Protected methods21.44%
▷ Private methods5237.41%
Functions33
▷ Named functions2575.76%
▷ Anonymous functions824.24%
Constants20
▷ Global constants00.00%
▷ Class constants20100.00%
▷ Public constants1890.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