68% sass-to-css-compiler

Code Review | Sass To CSS Compiler

WordPress plugin Sass To CSS Compiler scored68%from 54 tests.

About plugin

  • Plugin page: sass-to-css-compiler
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Apr 15, 2020
  • Latest release: Aug 27, 2023
  • Number of updates: 5
  • Update frequency: every 245.8 days
  • Top authors: sajjad67 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /1,240 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.13MB] [CPU: ▼3.27ms] Passed 4 tests

Server-side resources used by Sass To CSS Compiler
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1238.63 ▼0.06
Dashboard /wp-admin3.44 ▲0.1344.64 ▼5.60
Posts /wp-admin/edit.php3.55 ▲0.1946.14 ▼0.92
Add New Post /wp-admin/post-new.php6.01 ▲0.1393.92 ▼6.29
Media Library /wp-admin/upload.php3.36 ▲0.1333.61 ▼0.25

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 54 new files
Database: no new tables, 7 new options
New WordPress options
sasstocss_basic_settings
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Sass To CSS Compiler
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.30 ▼1.311.81 ▲0.0644.07 ▲4.63
Dashboard /wp-admin2,210 ▲224.86 ▼0.9698.25 ▼7.9939.50 ▼2.99
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0136.31 ▼4.3833.01 ▼2.19
Add New Post /wp-admin/post-new.php1,536 ▲823.55 ▲5.23608.17 ▼3.8553.06 ▼10.26
Media Library /wp-admin/upload.php1,392 ▲44.20 ▲0.01101.99 ▲5.2443.61 ▲0.94
Sass to CSS Compiler /wp-admin/sass-to-css-compiler.php260.440.1213.40

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • sasstocss_basic_settings

Smoke tests 50% 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 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
The following issues need your attention
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant SASSTOCSS_PLUGIN_PATH - assumed 'SASSTOCSS_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sass-to-css-compiler/admin/admin_settings.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/sass-to-css-compiler/includes/library/vendor/scssphp/scssphp/src/Formatter/Nested.php:23
    • > PHP Fatal error
      require(): Failed opening required 'SASSTOCSS_PLUGIN_PATHincludes/class.settings-api.php' (include_path='.:/usr/share/php') in wp-content/plugins/sass-to-css-compiler/admin/admin_settings.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/sass-to-css-compiler/includes/library/vendor/scssphp/scssphp/src/Formatter/Expanded.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/sass-to-css-compiler/includes/library/vendor/scssphp/scssphp/src/Formatter/Compact.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/sass-to-css-compiler/includes/library/vendor/scssphp/scssphp/src/Formatter/Compressed.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/sass-to-css-compiler/includes/library/vendor/scssphp/scssphp/src/Formatter/Debug.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\ode' not found in wp-content/plugins/sass-to-css-compiler/includes/library/vendor/scssphp/scssphp/src/Node/Number.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/sass-to-css-compiler/includes/library/vendor/scssphp/scssphp/src/Formatter/Crunched.php:22
    • > PHP Warning
      require(SASSTOCSS_PLUGIN_PATHincludes/class.settings-api.php): failed to open stream: No such file or directory in wp-content/plugins/sass-to-css-compiler/admin/admin_settings.php on line 15

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/sass-to-css-compiler.php
    • > Network (severe)
    wp-admin/sass-to-css-compiler.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: sass-compiler, scss, minify, compiler, enqueue-scripts...

sass-to-css-compiler/sass-to-css-compiler.php 92% from 13 tests

This is the main PHP file of "Sass To CSS Compiler" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Please make sure to remedy the following
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/sass-to-css-compiler/includes/library/vendor/bin/pscss.bat
9,894 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
PHP392,7503,5709,714
JSON300121
Markdown221045
Bourne Shell13110
DOS Batch1004

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 1,208)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 195)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity66.94
▷ Minimum class complexity1.00
▷ Maximum class complexity1,208.00
Average method complexity5.70
▷ Minimum method complexity1.00
▷ Maximum method complexity195.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes33
▷ Abstract classes26.06%
▷ Concrete classes3193.94%
▷ Final classes00.00%
Methods449
▷ Static methods194.23%
▷ Public methods14532.29%
▷ Protected methods29265.03%
▷ Private methods122.67%
Functions22
▷ Named functions29.09%
▷ Anonymous functions2090.91%
Constants69
▷ Global constants22.90%
▷ Class constants6797.10%
▷ Public constants67100.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
5 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/0.png5.55KB3.55KB▼ 36.05%
admin/assets/images/1.png5.22KB3.57KB▼ 31.58%
admin/assets/images/4.png4.43KB3.00KB▼ 32.25%
admin/assets/images/3.png5.07KB3.40KB▼ 33.02%
admin/assets/images/2.png5.03KB3.21KB▼ 36.16%