83% live-photos

Code Review | Live Photos on Wordpress

WordPress plugin Live Photos on Wordpress scored 83% from 54 tests.

About plugin

  • Plugin page: live-photos
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.7.3
  • WordPress version: 6.3.1
  • First release: Apr 24, 2017
  • Latest release: Apr 24, 2017
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: eggemplo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,058 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.01MB] [CPU: ▼2.56ms] Passed 4 tests

Analyzing server-side resources used by Live Photos on Wordpress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0141.14 ▼0.10
Dashboard /wp-admin3.32 ▲0.0252.03 ▲1.48
Posts /wp-admin/edit.php3.37 ▲0.0149.96 ▲1.03
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.28 ▼12.65
Media Library /wp-admin/upload.php3.24 ▲0.0139.05 ▲3.01

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Live Photos on Wordpress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲8815.25 ▲0.6043.72 ▲41.7943.72 ▲0.65
Dashboard /wp-admin2,206 ▲215.78 ▼0.1099.69 ▼6.2238.73 ▼2.08
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0037.43 ▼1.3530.89 ▼1.30
Add New Post /wp-admin/post-new.php1,534 ▼023.21 ▲0.03606.40 ▼21.0166.83 ▲14.52
Media Library /wp-admin/upload.php1,391 ▲34.17 ▼0.0698.10 ▼7.5242.95 ▼2.77

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/live-photos/livephotos.php on line 38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/live-photos/livephotos.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/live-photos/core/class-livephotos-shortcodes.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Example: Live Photos examples.) image missing
Please take inspiration from this readme.txt

live-photos/livephotos.php 85% from 13 tests

The entry point to "Live Photos on Wordpress" version 0.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("live-photos.php" instead of "livephotos.php")

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
Good job! No executable or dangerous file extensions detected173 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PO File16011494
PHP3359573
CSS1004
Bourne Shell1002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity4.00
Average method complexity1.27
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods11
▷ Static methods11100.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
1 PNG file occupies 0.43MB with 0.31MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png441.56KB124.70KB▼ 71.76%