10% google-drive-wp-media

Code Review | Google Drive WP Media

WordPress plugin Google Drive WP Media scored10%from 54 tests.

About plugin

  • Plugin page: google-drive-wp-m...
  • Plugin version: 2.4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7.2
  • WordPress version: 6.3.1
  • First release: Jan 23, 2014
  • Latest release: Feb 6, 2017
  • Number of updates: 128
  • Update frequency: every 8.7 days
  • Top authors: moch a (100%)

Code review

54 tests

User reviews

46 reviews

Install metrics

800+ active /62,346 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/google-drive-wp-media/google-drive-wp-media.php+40
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.07MB] [CPU: ▼54.08ms] Passed 4 tests

A check of server-side resources used by Google Drive WP Media
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.93 ▼0.5311.23 ▼31.17
Dashboard /wp-admin2.95 ▼0.408.82 ▼52.13
Posts /wp-admin/edit.php2.95 ▼0.4110.00 ▼39.37
Add New Post /wp-admin/post-new.php2.95 ▼2.949.33 ▼93.63
Media Library /wp-admin/upload.php2.95 ▼0.289.73 ▼20.70
GDWPM Categories /wp-admin/edit-tags.php?taxonomy=gdwpm_category&post_type=attachment2.958.71
Google Drive WP Media /wp-admin/upload.php?page=google-drive-wp-media2.959.96

Server storage [IO: ▲0.96MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 88 new files
Database: no new tables, 13 new options
New WordPress options
widget_theysaidso_widget
gdwpm_ukuran_preview
gdwpm_img_thumbs
db_upgraded
gdwpm_opsi_chunk
gdwpm_dummy_folder
can_compress_scripts
widget_recent-comments
widget_recent-posts
gdwpm_new_folder_kecing
...

Browser metrics Passed 4 tests

A check of browser resources used by Google Drive WP Media
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,068 ▲29714.71 ▲0.137.64 ▲5.5844.11 ▲0.07
Dashboard /wp-admin2,261 ▲765.82 ▼0.04122.03 ▲20.9138.33 ▼5.75
Posts /wp-admin/edit.php2,148 ▲622.68 ▲0.5448.50 ▲5.4155.77 ▲17.79
Add New Post /wp-admin/post-new.php1,569 ▲3623.61 ▲0.31645.75 ▼2.3336.09 ▼13.77
Media Library /wp-admin/upload.php1,443 ▲524.80 ▲0.5390.87 ▼7.8940.95 ▼2.56
GDWPM Categories /wp-admin/edit-tags.php?taxonomy=gdwpm_category&post_type=attachment1,3262.6335.6346.97
Google Drive WP Media /wp-admin/upload.php?page=google-drive-wp-media1,2293.2675.2070.93

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/google-drive-wp-media/google-drive-wp-media.php+40
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 13 options in the database
    • gdwpm_ukuran_preview
    • gdwpm_dummy_folder
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • gdwpm_opsi_kategori_dr_folder
    • gdwpm_img_thumbs
    • can_compress_scripts
    • widget_recent-posts
    • gdwpm_new_folder_kecing
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=google-drive-wp-media
    • > Notice in wp-content/plugins/google-drive-wp-media/google-drive-wp-media.php+1364
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/upload.php?page=google-drive-wp-media
    • > Deprecated in wp-content/plugins/google-drive-wp-media/gdwpm-api/service/Google_Utils.php+58
    Array and string offset access syntax with curly braces is deprecated

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
Almost there! Just fix the following items
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/google-drive-wp-media/google-drive-wp-media-options.php
    • > /wp-content/plugins/google-drive-wp-media/google-drive-wp-media-galleries.php
    • > /wp-content/plugins/google-drive-wp-media/google-drive-wp-media-albums.php
    • > /wp-content/plugins/google-drive-wp-media/google-drive-wp-media-themes.php
  • 19× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'io/Google_HttpRequest.php' (include_path='.:/usr/share/php') in wp-content/plugins/google-drive-wp-media/gdwpm-api/io/Google_IO.php on line 18
    • > PHP Warning
      require_once(service/Google_Utils.php): failed to open stream: No such file or directory in wp-content/plugins/google-drive-wp-media/gdwpm-api/auth/Google_OAuth2.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Signer' not found in wp-content/plugins/google-drive-wp-media/gdwpm-api/auth/Google_P12Signer.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/google-drive-wp-media/gdwpm-api/contrib/Google_DriveService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Verifier' not found in wp-content/plugins/google-drive-wp-media/gdwpm-api/auth/Google_PemVerifier.php:23
    • > PHP Warning
      require_once(service/Google_Utils.php): failed to open stream: No such file or directory in wp-content/plugins/google-drive-wp-media/gdwpm-api/auth/Google_OAuth2.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Cache' not found in wp-content/plugins/google-drive-wp-media/gdwpm-api/cache/Google_ApcCache.php:26
    • > PHP Fatal error
      require_once(): Failed opening required 'service/Google_Utils.php' (include_path='.:/usr/share/php') in wp-content/plugins/google-drive-wp-media/gdwpm-api/auth/Google_OAuth2.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Cache' not found in wp-content/plugins/google-drive-wp-media/gdwpm-api/cache/Google_MemcacheCache.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Google_IO' not found in wp-content/plugins/google-drive-wp-media/gdwpm-api/io/Google_CurlIO.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: You are using too many tags: 25 tag instead of maximum 10
The official readme.txt might help

google-drive-wp-media/google-drive-wp-media.php Passed 13 tests

The main PHP file in "Google Drive WP Media" ver. 2.4.4 adds more information about the plugin and also serves as the entry point for this plugin
136 characters long description:
WordPress Google Drive integration plugin. Google Drive on Wordpress Media Publishing. Upload files to Google Drive from WordPress blog.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected8,428 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP377253,4916,641
JavaScript52521161,430
CSS32514357

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.76
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity1.61
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes84
▷ Abstract classes55.95%
▷ Concrete classes7994.05%
▷ Final classes00.00%
Methods808
▷ Static methods182.23%
▷ Public methods77295.54%
▷ Protected methods91.11%
▷ Private methods273.34%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants628.57%
▷ Class constants1571.43%
▷ 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
31 PNG files occupy 0.17MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/animation/gdwpm-insert-shortcode.png0.71KB0.69KB▼ 1.94%
images/themes/humanity.png3.18KB3.17KB▼ 0.52%
images/themes/ui-darkness.png8.55KB4.62KB▼ 45.95%
images/animation/gdwpm_breaker_256.png14.55KB5.81KB▼ 60.10%
images/themes/sunny.png8.38KB3.90KB▼ 53.49%