10% google-document-embedder

Code Review | Google Doc Embedder

WordPress plugin Google Doc Embedder scored10%from 54 tests.

About plugin

  • Plugin page: google-document-e...
  • Plugin version: 2.6.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9
  • WordPress version: 6.3.1
  • First release: Sep 12, 2009
  • Latest release: May 1, 2018
  • Number of updates: 202
  • Update frequency: every 15.6 days
  • Top authors: k3davis (85.15%)danlester (15.35%)

Code review

54 tests

User reviews

91 reviews

Install metrics

30,000+ active /1,152,815 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/google-document-embedder/gviewer.php+263
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.13MB] [CPU: ▲0.98ms] Passed 4 tests

An overview of server-side resources used by Google Doc Embedder
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0839.54 ▼0.07
Dashboard /wp-admin3.45 ▲0.1551.24 ▲0.99
Posts /wp-admin/edit.php3.57 ▲0.2153.52 ▲6.62
Add New Post /wp-admin/post-new.php6.04 ▲0.15103.27 ▲4.51
Media Library /wp-admin/upload.php3.38 ▲0.1538.87 ▼1.53
GDE Settings /wp-admin/options-general.php?page=gde-settings3.4438.05

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 55 new files
Database: 2 new tables, 7 new options
New tables
wp_gde_profiles
wp_gde_secure
New WordPress options
gde_options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Google Doc Embedder: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.16 ▼0.191.58 ▼0.2943.01 ▼0.74
Dashboard /wp-admin2,199 ▲195.61 ▼0.0393.95 ▲3.5839.52 ▼2.22
Posts /wp-admin/edit.php2,104 ▲72.02 ▲0.0440.90 ▲4.5236.20 ▲1.71
Add New Post /wp-admin/post-new.php1,529 ▲323.64 ▲0.04680.95 ▼13.8259.02 ▲3.45
Media Library /wp-admin/upload.php1,407 ▲74.21 ▲0.01101.29 ▼6.4744.90 ▼1.60
GDE Settings /wp-admin/options-general.php?page=gde-settings1,4891.9036.81106.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_multisite() in wp-content/plugins/google-document-embedder/uninstall.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Default appearance of embedded viewer (cropped)), #2 (Enhanced viewer toolbar showing option to view full screen in same window), #3 (Enhanced viewer colors can be customized using basic settings or your own CSS file. This "dark" template is included as an example.), #4 (Preview of the settings page (portion of profile edit page)), #5 (TinyMCE Editor integration)
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

google-document-embedder/gviewer.php 85% from 13 tests

The primary PHP file in "Google Doc Embedder" version 2.6.4 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("google-document-embedder.php" instead of "gviewer.php")
  • Description: The description should be shorter than 140 characters (currently 150 characters long)

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
There were no executable files found in this plugin7,438 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PO File102,2612,9525,130
PHP133134061,606
JavaScript24832397
CSS36130292
HTML14013

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
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%
Functions56
▷ Named functions56100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.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
10 PNG files occupy 0.14MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/gde-dark-m-sprites.png1.08KB0.99KB▼ 8.42%
screenshot-2.png2.28KB1.43KB▼ 37.45%
img/gde-button.png0.85KB0.76KB▼ 11.31%
screenshot-1.png21.58KB8.86KB▼ 58.97%
img/sprite-fullscr.png0.36KB0.21KB▼ 42.78%