52% wp-vagrantize

Code Review | WP Vagrantize

WordPress plugin WP Vagrantize scored52%from 54 tests.

About plugin

  • Plugin page: wp-vagrantize
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.2-3.5.2
  • WordPress version: 6.3.1
  • First release: Aug 29, 2015
  • Latest release: Nov 18, 2015
  • Number of updates: 17
  • Update frequency: every 4.8 days
  • Top authors: amekusa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /871 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 gracefully, with no errors

Server metrics [RAM: ▼0.91MB] [CPU: ▼40.34ms] Passed 4 tests

Analyzing server-side resources used by WP Vagrantize
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.09 ▼3.20
Dashboard /wp-admin3.04 ▼0.2717.56 ▼32.86
Posts /wp-admin/edit.php3.04 ▼0.3219.64 ▼34.86
Add New Post /wp-admin/post-new.php3.04 ▼2.8519.50 ▼78.45
Media Library /wp-admin/upload.php3.04 ▼0.1917.85 ▼15.18
WP Vagrantize /wp-admin/tools.php?page=wp-vagrantize3.0414.78

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 432 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WP Vagrantize
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.16 ▼1.314.12 ▲1.9239.88 ▼8.43
Dashboard /wp-admin2,213 ▲254.86 ▼1.02107.33 ▼2.8841.16 ▼2.65
Posts /wp-admin/edit.php2,096 ▲71.99 ▼0.0339.72 ▲5.1735.37 ▼1.66
Add New Post /wp-admin/post-new.php1,538 ▼423.23 ▲5.05631.84 ▲31.5152.59 ▲0.77
Media Library /wp-admin/upload.php1,395 ▲104.23 ▲0.0294.24 ▼7.7943.96 ▼0.72
WP Vagrantize /wp-admin/tools.php?page=wp-vagrantize1,5981.8641.4639.27

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
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/wp-vagrantize/lib/composer/interconnectit/search-replace-db/srdb.class.php+854
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=wp-vagrantize
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/wp-vagrantize/lib/composer/interconnectit/search-replace-db/srdb.class.php+854
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

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
  • 7× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-vagrantize/lib/composer/interconnectit/search-replace-db/srdb-tests/DataSetGenerator.php
    • > /wp-content/plugins/wp-vagrantize/src/view/SettingsTable.php
    • > /wp-content/plugins/wp-vagrantize/lib/composer/interconnectit/search-replace-db/srdb.cli.php
    • > /wp-content/plugins/wp-vagrantize/lib/composer/mustangostang/spyc/examples/yaml-load.php
    • > /wp-content/plugins/wp-vagrantize/lib/composer/mustangostang/spyc/php4/5to4.php
    • > /wp-content/plugins/wp-vagrantize/lib/composer/interconnectit/search-replace-db/index.php
    • > /wp-content/plugins/wp-vagrantize/lib/composer/codeless/logmore/buildsrc/logmore.php
  • 34× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant STDERR - assumed 'STDERR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-vagrantize/lib/composer/interconnectit/search-replace-db/srdb.cli.php on line 136
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-vagrantize/wp-vagrantize.php:12
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/wp-vagrantize/src/view/SettingsTable.php on line 3
    • > PHP Warning
      fwrite() expects parameter 1 to be resource, string given in wp-content/plugins/wp-vagrantize/lib/composer/interconnectit/search-replace-db/srdb.cli.php on line 143
    • > PHP Warning
      Use of undefined constant STDERR - assumed 'STDERR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-vagrantize/lib/composer/interconnectit/search-replace-db/srdb.cli.php on line 136
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-vagrantize/src/view/SettingsTable.php on line 3
    • > PHP Warning
      Use of undefined constant STDERR - assumed 'STDERR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-vagrantize/lib/composer/interconnectit/search-replace-db/srdb.cli.php on line 136
    • > PHP Warning
      Use of undefined constant STDERR - assumed 'STDERR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-vagrantize/lib/composer/interconnectit/search-replace-db/srdb.cli.php on line 143
    • > PHP Warning
      Use of undefined constant STDERR - assumed 'STDERR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-vagrantize/lib/composer/interconnectit/search-replace-db/srdb.cli.php on line 136
    • > PHP Fatal error
      Uncaught PDOException: SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' in wp-content/plugins/wp-vagrantize/lib/composer/interconnectit/search-replace-db/srdb-tests/charset-test.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Customizing settings of a virtual machine), #2 (Downloading a provisioning file as a ZIP)
The official readme.txt might help

wp-vagrantize/wp-vagrantize.php Passed 13 tests

This is the main PHP file of "WP Vagrantize" version 1.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
57 characters long description:
A smart way to reproduce your blog into the local machine

Code Analysis 5% 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
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .awk - AWK Script in AWK
      • wp-content/plugins/wp-vagrantize/lib/composer/codeless/logmore/buildsrc/extract.awk
25,290 lines of code in 381 files:
LanguageFilesBlank linesComment linesLines of code
PHP421,9482,2257,083
ERB601,12905,917
Ruby2051,1552,8375,355
Markdown291,15803,555
XML35001,535
JSON1710818
YAML14108100350
JavaScript1310228
SQL32610151
CSS16381
make216573
Bourne Shell119068
Perl111030
Bourne Again Shell15028
awk171718

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity21.32
▷ Minimum class complexity1.00
▷ Maximum class complexity227.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes34
▷ Abstract classes617.65%
▷ Concrete classes2882.35%
▷ Final classes00.00%
Methods401
▷ Static methods368.98%
▷ Public methods33984.54%
▷ Protected methods41.00%
▷ Private methods5814.46%
Functions15
▷ Named functions746.67%
▷ Anonymous functions853.33%
Constants34
▷ Global constants1955.88%
▷ Class constants1544.12%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.23MB with 0.15MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png63.47KB27.70KB▼ 56.36%
screenshot-2.png174.14KB51.71KB▼ 70.31%