84% simple-google-docs-viewer

Code Review | Simple Google Docs Viewer

WordPress plugin Simple Google Docs Viewer scored84%from 54 tests.

About plugin

  • Plugin page: simple-google-doc...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7.1
  • WordPress version: 6.3.1
  • First release: Dec 20, 2012
  • Latest release: Mar 22, 2017
  • Number of updates: 11
  • Update frequency: every 141.2 days
  • Top authors: illuminea (54.55%)maor (54.55%)

Code review

54 tests

User reviews

8 reviews

Install metrics

600+ active /19,482 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.82ms] Passed 4 tests

Server-side resources used by Simple Google Docs Viewer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.23 ▼6.06
Dashboard /wp-admin3.32 ▲0.0149.63 ▼16.70
Posts /wp-admin/edit.php3.37 ▲0.0147.28 ▼2.72
Add New Post /wp-admin/post-new.php5.90 ▲0.01104.12 ▲4.27
Media Library /wp-admin/upload.php3.24 ▲0.0135.15 ▼1.79

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Simple Google Docs Viewer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▲0.101.86 ▼0.1243.40 ▲0.76
Dashboard /wp-admin2,206 ▲214.86 ▼0.0699.20 ▼18.7139.09 ▼4.54
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0234.59 ▼1.5234.57 ▲0.55
Add New Post /wp-admin/post-new.php1,542 ▲2818.58 ▲1.00624.73 ▼88.6662.06 ▼6.14
Media Library /wp-admin/upload.php1,388 ▼04.21 ▼0.0195.81 ▼15.2743.22 ▼4.18

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-google-docs-viewer/simple-google-docs-viewer.php:116

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (How an embedded document looks in the front-end.), #2 (A sample use of the "gviewer" shortcode.)
You can look at the official readme.txt

simple-google-docs-viewer/simple-google-docs-viewer.php Passed 13 tests

Analyzing the main PHP file in "Simple Google Docs Viewer" version 1.2
122 characters long description:
Enables you to easily embed documents with Google Docs Viewer - that are supported by Google Docs (PDF/DOC/DOCX/PPTX/etc).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin47 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1135647

PHP code Passed 2 tests

Analyzing 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.38
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods125.00%
▷ Public methods250.00%
▷ Protected methods00.00%
▷ Private methods250.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin