78% urlslab

Code Review | URLsLab

WordPress plugin URLsLab scored78%from 54 tests.

About plugin

  • Plugin page: urlslab
  • Plugin version: 2.112.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 10, 2023
  • Latest release: Dec 1, 2023
  • Number of updates: 29
  • Update frequency: every 1.9 days
  • Top authors: urlslab (93.1%)martin.stepanek (10.34%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /616 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲4.71MB] [CPU: ▲41.77ms] Passed 4 tests

An overview of server-side resources used by URLsLab
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /7.85 ▲4.3861.58 ▲15.17
Dashboard /wp-admin8.14 ▲4.8399.01 ▲46.23
Posts /wp-admin/edit.php8.20 ▲4.84100.29 ▲60.96
Add New Post /wp-admin/post-new.php10.83 ▲4.95142.25 ▲52.40
Media Library /wp-admin/upload.php7.99 ▲4.7687.69 ▲53.27

Server storage [IO: ▲18.74MB] [DB: ▲0.06MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 1,808 new files
Database: 41 new tables, 146 new options
New tables
wp_urlslab_generator_shortcodes
wp_urlslab_related_urls
wp_urlslab_urls_map
wp_urlslab_generator_tasks
wp_urlslab_labels
wp_urlslab_serp_positions
wp_urlslab_serp_domains
wp_urlslab_search_replace
wp_urlslab_log_notfound
wp_urlslab_cache_rules
...
New WordPress options
urlslab-relres-show-sum
urlslab_js_max_size
urlslab_img_lazy_placeholder
can_compress_scripts
urlslab_auto_sum_ext_links
urlslab_avif_types
urlslab_tw_player_width
widget_recent-comments
urlslab_css_max_size
urlslab_tw_googleplay_name
...

Browser metrics Passed 4 tests

An overview of browser requirements for URLsLab
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,230 ▲46816.43 ▲2.2710.41 ▲8.6437.81 ▼6.86
Dashboard /wp-admin2,388 ▲2116.92 ▲1.30126.79 ▲22.38101.35 ▲59.18
Posts /wp-admin/edit.php2,357 ▲2573.60 ▲1.6363.19 ▲26.1060.12 ▲25.40
Add New Post /wp-admin/post-new.php1,616 ▲9025.52 ▲2.33634.66 ▼23.9034.23 ▼17.03
Media Library /wp-admin/upload.php1,474 ▲774.99 ▲0.8085.10 ▼15.3483.37 ▲38.91

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

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)
Good news, no errors were detected

SRP 0% 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
Please fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/urlslab/vendor/mtdowling/jmespath.php/bin/jp.php
    • > /wp-content/plugins/urlslab/uninstall.php
    • > /wp-content/plugins/urlslab/admin/templates/page/urlslab-admin-dashboard.php
  • 791× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Urlslab_Widget' not found in wp-content/plugins/urlslab/includes/widget/class-urlslab-widget-web-vitals.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/urlslab/vendor/guzzlehttp/psr7/src/LimitStream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Urlslab_Vendor\\PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/urlslab/vendor_prefixed/urlslab-client/urlslab/urlslab-php-sdk/test/Api/CreditsApiTest.php:40
    • > PHP Fatal error
      Uncaught Error: Interface 'Urlslab_Vendor\\OpenAPI\\Client\\Model\\ModelInterface' not found in wp-content/plugins/urlslab/vendor_prefixed/urlslab-client/urlslab/urlslab-php-sdk/lib/Model/DomainScheduleScheduleConf.php:40
    • > PHP Fatal error
      Uncaught Error: Interface 'Aws\\MonitoringEventsInterface' not found in wp-content/plugins/urlslab/vendor/aws/aws-sdk-php/src/Exception/InvalidJsonException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Urlslab_Vendor\\PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/urlslab/vendor_prefixed/urlslab-client/urlslab/urlslab-php-sdk/test/Model/DomainDataRetrievalVideoCaptionResponseTest.php:39
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/urlslab/table-names.php on line 43
    • > PHP Fatal error
      Uncaught Error: Interface 'Urlslab_Vendor\\OpenAPI\\Client\\Model\\ModelInterface' not found in wp-content/plugins/urlslab/vendor_prefixed/urlslab-client/urlslab/urlslab-php-sdk/lib/Model/DomainUserCreditCreditEvent.php:40
    • > PHP Fatal error
      Uncaught Error: Interface 'OpenAPI\\Client\\Model\\ModelInterface' not found in wp-content/plugins/urlslab/vendor/urlslab/urlslab-php-sdk/lib/Model/DomainDataRetrievalKeywordAnalyticsResponse.php:43
    • > PHP Fatal error
      Uncaught Error: Interface 'Urlslab_Vendor\\Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/urlslab/vendor_prefixed/urlslab-client/guzzlehttp/psr7/src/UploadedFile.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: optimizer, database, seo, gpt, cache...

urlslab/urlslab.php Passed 13 tests

The principal PHP file in "URLsLab" v. 2.112.2 is loaded by WordPress automatically on each request
102 characters long description:
URLsLab WordPress Plugin to optimize your website for search engines and enhance automatically content

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
Good job! No executable or dangerous file extensions detected361,700 lines of code in 1,930 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1284104,481177,860
PHP1,23320,85874,015136,463
JSX2232,45835221,568
CSS19406328,154
Markdown452,51716,609
Sass791,539666,265
JSON46101,800
TypeScript1910374958
SVG12102930
C111825668
YAML6283151
XML560101
Bourne Shell231874
reStructuredText1352959
m418032
C/C++ Header14128

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 139)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity15.04
▷ Minimum class complexity1.00
▷ Maximum class complexity229.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity139.00
Code structure
Namespaces125
Interfaces99
Traits24
Classes978
▷ Abstract classes474.81%
▷ Concrete classes93195.19%
▷ Final classes899.56%
Methods11,346
▷ Static methods1,80315.89%
▷ Public methods9,39082.76%
▷ Protected methods4864.28%
▷ Private methods1,47012.96%
Functions2,108
▷ Named functions1436.78%
▷ Anonymous functions1,96593.22%
Constants1,353
▷ Global constants604.43%
▷ Class constants1,29395.57%
▷ Public constants1,23695.59%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
22 PNG files occupy 0.31MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/dist/assets/wordpress-x6kt4wnaug.png2.33KB2.29KB▼ 1.68%
admin/src/assets/images/bots/yandex.png2.24KB1.35KB▼ 39.66%
admin/src/assets/images/os/WIN.png0.81KB0.78KB▼ 3.72%
admin/src/assets/images/bots/amazon.png2.32KB1.55KB▼ 33.07%
admin/src/assets/images/os/IPA.png1.08KB1.44KB0.00%