79% dans-gdrive-viewer

Code Review | Dan's Viewer for Google Drive

WordPress plugin Dan's Viewer for Google Drive scored79%from 54 tests.

About plugin

  • Plugin page: dans-gdrive-viewer
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.2.1
  • WordPress version: 6.3.1
  • First release: Oct 25, 2016
  • Latest release: Jun 5, 2019
  • Number of updates: 10
  • Update frequency: every 95.3 days
  • Top authors: duplaja (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

200+ active /4,957 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼0.87ms] Passed 4 tests

Analyzing server-side resources used by Dan's Viewer for Google Drive
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.66 ▼3.33
Dashboard /wp-admin3.33 ▲0.0345.71 ▼8.62
Posts /wp-admin/edit.php3.38 ▲0.0349.50 ▲5.94
Add New Post /wp-admin/post-new.php5.91 ▲0.0394.45 ▲3.69
Media Library /wp-admin/upload.php3.26 ▲0.0335.79 ▲4.77
Dan's gDrive /wp-admin/tools.php?page=dans-gdrive-settings3.2031.91

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Dan's Viewer for Google Drive
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲17513.59 ▼0.784.98 ▲3.3039.82 ▼7.25
Dashboard /wp-admin2,210 ▲225.90 ▲1.00111.60 ▲6.3442.38 ▲6.03
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.1439.33 ▲4.3235.10 ▼1.91
Add New Post /wp-admin/post-new.php1,534 ▲1418.48 ▼4.71603.79 ▼44.2262.40 ▲12.60
Media Library /wp-admin/upload.php1,392 ▲44.20 ▼0.0196.15 ▼0.5041.34 ▼3.11
Dan's gDrive /wp-admin/tools.php?page=dans-gdrive-settings8772.1826.3428.38

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/tools.php?page=dans-gdrive-settings
    • > Warning in wp-content/plugins/dans-gdrive-viewer/dans-gdrive-viewer.php+111
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/tools.php?page=dans-gdrive-settings
    • > Notice in wp-content/plugins/dans-gdrive-viewer/dans-gdrive-viewer.php+123
    Trying to access array offset on value of type bool

SRP 50% 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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dans-gdrive-viewer/dans-gdrive-viewer.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: share files, dan, google drive, gdrive, embed...

dans-gdrive-viewer/dans-gdrive-viewer.php Passed 13 tests

The main PHP script in "Dan's Viewer for Google Drive" version 1.2 is automatically included on every request by WordPress
66 characters long description:
A custom Google Drive Viewer w/ Folder Transversal and File Export

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin247 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP212134198
JavaScript116149

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin