88% xcloner-google-drive

Code Review | XCloner Google Drive

WordPress plugin XCloner Google Drive scored 88% from 54 tests.

About plugin

  • Plugin page: xcloner-google-drive
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4
  • WordPress version: 5.9.2
  • First release: Mar 7, 2017
  • Latest release: Aug 4, 2020
  • Number of updates: 27
  • Update frequency: every 45.9 days
  • Top authors: xcloner (70.37%)watchful (33.33%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active / 23,472 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.54MB] [CPU: ▼284.08ms] Passed 4 tests

An overview of server-side resources used by XCloner Google Drive
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.08 ▲0.5758.06 ▲5.46
Dashboard /wp-admin3.98 ▲0.5736.37 ▲4.74
Posts /wp-admin/edit.php4.20 ▲0.5640.49 ▲3.51
Add New Post /wp-admin/post-new.php7.45 ▲0.4895.89 ▼1,144.96
Media Library /wp-admin/upload.php3.85 ▲0.5627.23 ▲0.39

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 578 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for XCloner Google Drive
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,767 ▲1215.82 ▲0.185.76 ▼0.562.19 ▼0.53
Dashboard /wp-admin2,892 ▲316.22 ▲0.06131.95 ▼3.71165.17 ▲3.64
Posts /wp-admin/edit.php2,695 ▲43.23 ▼0.0164.31 ▲1.26140.02 ▼2.46
Add New Post /wp-admin/post-new.php1,670 ▲920.73 ▲4.19408.44 ▲4.97157.79 ▲1.20
Media Library /wp-admin/upload.php1,694 ▼45.56 ▲0.06134.96 ▼4.36185.20 ▼2.93

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/xcloner-google-drive/public/partials/xcloner-google-drive-public-display.php
    • > /wp-content/plugins/xcloner-google-drive/admin/partials/xcloner-google-drive-admin-display.php
  • 276× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'League\\Flysystem\\Cached\\Storage\\AbstractCache' not found in wp-content/plugins/xcloner-google-drive/vendor/league/flysystem-cached-adapter/src/Storage/Adapter.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'League\\Flysystem\\Cached\\Storage\\AbstractCache' not found in wp-content/plugins/xcloner-google-drive/vendor/league/flysystem-cached-adapter/src/Storage/Memory.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\Flysystem\\AdapterInterface' not found in wp-content/plugins/xcloner-google-drive/vendor/league/flysystem-cached-adapter/src/CachedAdapter.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\Flysystem\\Cached\\CacheInterface' not found in wp-content/plugins/xcloner-google-drive/vendor/league/flysystem-cached-adapter/src/Storage/AbstractCache.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/xcloner-google-drive/vendor/guzzlehttp/promises/src/Promise.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\Flysystem\\FilesystemInterface' not found in wp-content/plugins/xcloner-google-drive/vendor/league/flysystem/src/Filesystem.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/xcloner-google-drive/vendor/guzzlehttp/psr7/src/FnStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Google\\Auth\\FetchAuthTokenInterface' not found in wp-content/plugins/xcloner-google-drive/vendor/google/auth/src/OAuth2.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/xcloner-google-drive/vendor/google/apiclient-services/src/Google/Service/Drive.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Exception' not found in wp-content/plugins/xcloner-google-drive/vendor/google/apiclient/src/Google/Task/Exception.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Screenshot #1 (General Settings) image missing
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === xcloner-google-drive === )
The official readme.txt is a good inspiration

xcloner-google-drive/xcloner-google-drive.php Passed 13 tests

Analyzing the main PHP file in "XCloner Google Drive" version 1.0.6
81 characters long description:
Google Drive Remote Storage Implementation for XCloner Backup and Restore plugin.

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
Success! There were no dangerous files found in this plugin76,436 lines of code in 539 files:
LanguageFilesBlank linesComment linesLines of code
PHP4639,88531,75869,180
Markdown341,56104,765
JSON25002,220
YAML6130136
XML400107
Dockerfile18010
make1409
JavaScript24546
Bourne Shell1203
CSS2080

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity17.42
▷ Minimum class complexity1.00
▷ Maximum class complexity632.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces50
Interfaces40
Traits17
Classes366
▷ Abstract classes143.83%
▷ Concrete classes35296.17%
▷ Final classes185.11%
Methods3,691
▷ Static methods2205.96%
▷ Public methods3,17285.94%
▷ Protected methods2346.34%
▷ Private methods2857.72%
Functions200
▷ Named functions7839.00%
▷ Anonymous functions12261.00%
Constants466
▷ Global constants6614.16%
▷ Class constants40085.84%
▷ Public constants400100.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
1 PNG file occupies 0.08MB with 0.06MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png80.03KB23.69KB▼ 70.39%