57% climbing-cartboard

Code Review | Climbing Cardboard

WordPress plugin Climbing Cardboard scored57%from 54 tests.

About plugin

  • Plugin page: climbing-cartboard
  • Plugin version: 1.0.9
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Sep 11, 2022
  • Latest release: Jan 8, 2023
  • Number of updates: 11
  • Update frequency: every 10.9 days
  • Top authors: gardelin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /238 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.59MB] [CPU: ▼6.33ms] Passed 4 tests

Server-side resources used by Climbing Cardboard
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4142.97 ▲2.22
Dashboard /wp-admin4.01 ▲0.6655.01 ▼12.41
Posts /wp-admin/edit.php4.06 ▲0.7052.27 ▼1.77
Add New Post /wp-admin/post-new.php6.54 ▲0.6691.58 ▼13.36
Media Library /wp-admin/upload.php3.87 ▲0.6446.53 ▲12.01

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 1,692 new files
Database: 1 new table, 7 new options
New tables
wp_climbing_cards
New WordPress options
climbing_card_db_schema_version
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Climbing Cardboard
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,935 ▲17414.69 ▲0.2640.94 ▲39.0737.82 ▼2.16
Dashboard /wp-admin2,280 ▲745.82 ▼0.07110.74 ▲1.9945.66 ▲4.71
Posts /wp-admin/edit.php2,164 ▲642.01 ▼0.0136.36 ▼4.0840.98 ▲0.82
Add New Post /wp-admin/post-new.php1,394 ▼15121.66 ▼1.61553.07 ▼121.6054.95 ▼0.81
Media Library /wp-admin/upload.php1,456 ▲564.32 ▲0.08107.21 ▼3.4147.10 ▲1.65

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
Please fix the following items
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_climbing_cards
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • climbing_card_db_schema_version
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 fix the following
  • 10× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/climbing-cartboard/vendor/illuminate/pagination/resources/views/simple-bootstrap-4.blade.php
    • > /wp-content/plugins/climbing-cartboard/vendor/illuminate/pagination/resources/views/semantic-ui.blade.php
    • > /wp-content/plugins/climbing-cartboard/vendor/illuminate/pagination/resources/views/simple-tailwind.blade.php
    • > /wp-content/plugins/climbing-cartboard/vendor/illuminate/pagination/resources/views/tailwind.blade.php
    • > /wp-content/plugins/climbing-cartboard/vendor/league/plates/example/templates/sidebar.php
    • > /wp-content/plugins/climbing-cartboard/vendor/illuminate/pagination/resources/views/bootstrap-4.blade.php
    • > /wp-content/plugins/climbing-cartboard/resources/views/admin/cards/index.php
    • > /wp-content/plugins/climbing-cartboard/resources/views/cards/partials/table.php
    • > /wp-content/plugins/climbing-cartboard/vendor/illuminate/pagination/resources/views/simple-default.blade.php
    • > /wp-content/plugins/climbing-cartboard/vendor/illuminate/pagination/resources/views/default.blade.php
  • 249× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Dumper\\FileDumper' not found in wp-content/plugins/climbing-cartboard/vendor/symfony/translation/Dumper/PoFileDumper.php:21
    • > PHP Warning
      include(../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/climbing-cartboard/vendor/league/plates/example/example.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Translator' not found in wp-content/plugins/climbing-cartboard/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php:21
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/climbing-cartboard/vendor/league/plates/example/templates/layout.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Pagination\\AbstractPaginator' not found in wp-content/plugins/climbing-cartboard/vendor/illuminate/pagination/Paginator.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'ClimbingCard\\Http\\Api\\ApiController' not found in wp-content/plugins/climbing-cartboard/src/Http/Api/SettingsController.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Doctrine\\Inflector\\GenericLanguageInflectorFactory' not found in wp-content/plugins/climbing-cartboard/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/InflectorFactory.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon\\PHPStan\\AbstractMacro' not found in wp-content/plugins/climbing-cartboard/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Extractor\\ExtractorInterface' not found in wp-content/plugins/climbing-cartboard/vendor/symfony/translation/Extractor/ChainExtractor.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Loader\\LoaderInterface' not found in wp-content/plugins/climbing-cartboard/vendor/symfony/translation/Loader/IcuResFileLoader.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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: climbing, routes, sport, stats, logbook

climbing-cartboard/activation.php 77% from 13 tests

"Climbing Cardboard" version 1.0.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
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 ("climbing-cartboard.php" instead of "activation.php")
  • Domain Path: The domain path is invalid: folder "/resources/lang" does not exist
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Please make sure to remedy the following
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/climbing-cartboard/vendor/nesbot/carbon/bin/carbon.bat
62,798 lines of code in 1,454 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,35811,38940,30854,739
XSD392482,803
Markdown4483112,411
JSON21002,021
Blade71826257
PO File2100194228
HTML592114
reStructuredText1747874
YAML13035
XML13033
CSS45827
JavaScript401421
SVG15019
TOML13012
DOS Batch1004

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 140)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity8.92
▷ Minimum class complexity1.00
▷ Maximum class complexity315.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity140.00
Code structure
Namespaces92
Interfaces150
Traits36
Classes312
▷ Abstract classes216.73%
▷ Concrete classes29193.27%
▷ Final classes3813.06%
Methods3,685
▷ Static methods76920.87%
▷ Public methods3,26488.58%
▷ Protected methods2947.98%
▷ Private methods1273.45%
Functions542
▷ Named functions14326.38%
▷ Anonymous functions39973.62%
Constants212
▷ Global constants198.96%
▷ Class constants19391.04%
▷ Public constants18897.41%

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
3 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/league/plates/doc/static/images/logo.png2.25KB1.53KB▼ 32.22%
public/assets/images/logo.png32.65KB28.94KB▼ 11.35%
vendor/league/plates/doc/static/favicon/apple-touch-icon-precomposed.png5.40KB2.79KB▼ 48.42%