84% google-photos-embed

Code Review | Google Photos embed

WordPress plugin Google Photos embed scored84%from 54 tests.

About plugin

  • Plugin page: google-photos-embed
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.8
  • WordPress version: 6.3.1
  • First release: Nov 6, 2015
  • Latest release: Sep 8, 2017
  • Number of updates: 8
  • Update frequency: every 84.1 days
  • Top authors: enomoto celtislab (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active /17,544 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼6.12ms] Passed 4 tests

Server-side resources used by Google Photos embed
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0643.93 ▼0.90
Dashboard /wp-admin3.37 ▲0.0653.66 ▼1.96
Posts /wp-admin/edit.php3.42 ▲0.0655.80 ▲2.04
Add New Post /wp-admin/post-new.php5.95 ▲0.0689.94 ▼20.51
Media Library /wp-admin/upload.php3.29 ▲0.0638.98 ▼1.11

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Google Photos embed
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▲0.191.84 ▲0.0943.34 ▼3.30
Dashboard /wp-admin2,195 ▲185.61 ▼0.0086.31 ▼2.2540.93 ▲0.72
Posts /wp-admin/edit.php2,100 ▼31.99 ▲0.0140.29 ▼4.7436.24 ▼1.39
Add New Post /wp-admin/post-new.php1,526 ▼223.05 ▲0.00637.25 ▲4.2054.84 ▼7.89
Media Library /wp-admin/upload.php1,397 ▼04.17 ▼0.03101.08 ▼3.9944.68 ▲1.50

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
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 add_action() in wp-content/plugins/google-photos-embed/google-photos-embed.php:347

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (Get Google Photos share url. Copy & Paste embed.) image not found
Please take inspiration from this readme.txt

google-photos-embed/google-photos-embed.php Passed 13 tests

The main PHP file in "Google Photos embed" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
78 characters long description:
Using shared short URL of Google Photos, you can embed the image easy to 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
No dangerous file extensions were detected236 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12388236

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.73
Average class complexity76.00
▷ Minimum class complexity76.00
▷ Maximum class complexity76.00
Average method complexity9.33
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods666.67%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png43.90KB34.98KB▼ 20.31%