10% stackla

Code Review | Stackla

WordPress plugin Stackla scored10%from 54 tests.

About plugin

  • Plugin page: stackla
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.6
  • WordPress version: 6.3.1
  • First release: Mar 3, 2016
  • Latest release: Mar 11, 2016
  • Number of updates: 16
  • Update frequency: every 12.6 days
  • Top authors: helmanbudianto (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /993 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/stackla/includes/class-stackla-wp-remover.php+26
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Server metrics [RAM: ▼1.62MB] [CPU: ▼57.18ms] Passed 4 tests

Analyzing server-side resources used by Stackla
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.37 ▼1.097.60 ▼36.69
Dashboard /wp-admin2.39 ▼0.918.06 ▼47.34
Posts /wp-admin/edit.php2.39 ▼0.978.66 ▼42.05
Add New Post /wp-admin/post-new.php2.39 ▼3.508.05 ▼102.64
Media Library /wp-admin/upload.php2.39 ▼0.848.36 ▼30.51

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 1,294 new files
Database: 1 new table, 6 new options
New tables
stackla_settings
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Stackla
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,892 ▲13115.65 ▲1.105.81 ▲4.3139.47 ▼0.75
Dashboard /wp-admin2,203 ▲266.81 ▲1.01119.98 ▲26.1172.49 ▲25.11
Posts /wp-admin/edit.php2,129 ▲293.43 ▲1.4151.12 ▲8.8934.60 ▼2.75
Add New Post /wp-admin/post-new.php1,551 ▲2319.13 ▼3.95701.36 ▲28.0236.91 ▼21.89
Media Library /wp-admin/upload.php1,415 ▲155.41 ▲1.10118.39 ▲1.2076.14 ▲26.79

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
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/stackla/includes/class-stackla-wp-remover.php+26
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 take a closer look at the following
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/stackla/includes/vendor/stackla/stackla-php-sdk/tests/callback/access.php
    • > /wp-content/plugins/stackla/public/partials/plugin-name-public-display.php
    • > /wp-content/plugins/stackla/includes/vendor/stackla/stackla-php-sdk/tests/bootstrap.php
    • > /wp-content/plugins/stackla/includes/vendor/stackla/stackla-php-sdk/src/Stackla/Exception/StacklaException.php
    • > /wp-content/plugins/stackla/includes/vendor/stackla/stackla-php-sdk/tests/callback/callback.php
  • 781× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Validator\\Mapping\\ElementMetadata' not found in wp-content/plugins/stackla/includes/vendor/symfony/validator/Mapping/ClassMetadata.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/stackla/includes/vendor/symfony/translation/Tests/Loader/JsonFileLoaderTest.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Validator\\Context\\ExecutionContextFactoryInterface' not found in wp-content/plugins/stackla/includes/vendor/symfony/validator/Context/ExecutionContextFactory.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Tests\\Parsers\\UriTemplate\\AbstractUriTemplateTest' not found in wp-content/plugins/stackla/includes/vendor/guzzle/guzzle/tests/Guzzle/Tests/Parser/UriTemplate/PeclUriTemplateTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Validator\\Constraint' not found in wp-content/plugins/stackla/includes/vendor/symfony/validator/Constraints/Isbn.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Tests\\Service\\Command\\LocationVisitor\\Request\\AbstractVisitorTestCase' not found in wp-content/plugins/stackla/includes/vendor/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/LocationVisitor/Request/BodyVisitorTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Http\\Exception\\BadResponseException' not found in wp-content/plugins/stackla/includes/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/ServerErrorResponseException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/stackla/includes/vendor/symfony/yaml/Tests/ParserTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Validator\\Constraints\\Optional' not found in wp-content/plugins/stackla/includes/vendor/symfony/validator/Constraints/Collection/Optional.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Stackla\\Core\\StacklaModel' not found in wp-content/plugins/stackla/includes/vendor/stackla/stackla-php-sdk/src/Stackla/Api/Widget.php:28

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: widget, ugc, social, stackla

stackla/stackla-wp.php 92% from 13 tests

The main PHP file in "Stackla" ver. 1.0.4 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("stackla.php" instead of "stackla-wp.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin129,128 lines of code in 1,212 files:
LanguageFilesBlank linesComment linesLines of code
PHP96115,03829,82366,012
JavaScript216,28528,01434,439
XML69752914,120
YAML261431003,238
XSD370282,594
Markdown2146402,016
JSON461301,963
reStructuredText301,2361,7941,824
JSX111151871,557
Sass4530661
CSS4196143
Ant2231131
make1245124
SVG202117
HTML216095
Python1222349
PO File55029
Qt Linguist10010
INI2106

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 155)
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity6.16
▷ Minimum class complexity1.00
▷ Maximum class complexity158.00
Average method complexity1.96
▷ Minimum method complexity1.00
▷ Maximum method complexity155.00
Code structure
Namespaces147
Interfaces105
Traits0
Classes870
▷ Abstract classes525.98%
▷ Concrete classes81894.02%
▷ Final classes141.71%
Methods5,650
▷ Static methods1933.42%
▷ Public methods4,85185.86%
▷ Protected methods62411.04%
▷ Private methods1753.10%
Functions220
▷ Named functions52.27%
▷ Anonymous functions21597.73%
Constants334
▷ Global constants00.00%
▷ Class constants334100.00%
▷ Public constants334100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
19 PNG files occupy 2.23MB with 0.62MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/styles/base_slideshow.png0.29KB0.23KB▼ 20.07%
includes/vendor/guzzle/guzzle/docs/_static/guzzle-icon.png0.78KB0.94KB0.00%
admin/img/poweredByLogo.png3.15KB1.43KB▼ 54.42%
admin/img/styles/mrec.png0.22KB0.18KB▼ 19.91%
admin/img/types/derive.png2.48KB1.38KB▼ 44.42%