84% tablet-photography

Code Review | Tablet Photography

WordPress plugin Tablet Photography scored84%from 54 tests.

About plugin

  • Plugin page: tablet-photography
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.2.2
  • WordPress version: 6.3.1
  • First release: Feb 6, 2013
  • Latest release: Aug 28, 2019
  • Number of updates: 18
  • Update frequency: every 133.0 days
  • Top authors: erwanpia (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

20+ active /2,436 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
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Tablet Photography
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.92 ▼4.04
Dashboard /wp-admin3.32 ▲0.0146.79 ▼2.95
Posts /wp-admin/edit.php3.37 ▲0.0145.17 ▼0.38
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.49 ▼9.84
Media Library /wp-admin/upload.php3.24 ▲0.0133.46 ▲0.49

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Tablet Photography
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲17013.80 ▼0.958.04 ▲6.4042.81 ▼7.45
Dashboard /wp-admin2,203 ▲155.79 ▼0.0799.88 ▼16.9837.37 ▼5.12
Posts /wp-admin/edit.php2,089 ▼31.98 ▼0.0836.69 ▼0.2135.81 ▲2.76
Add New Post /wp-admin/post-new.php1,542 ▲2817.94 ▲0.42620.44 ▼79.7648.69 ▼3.07
Media Library /wp-admin/upload.php1,385 ▼64.17 ▼0.0094.90 ▼0.0640.19 ▼8.69

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

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

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)
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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/tablet-photography/tablet-photography.php:17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === tablet-photography === )
Please take inspiration from this readme.txt

tablet-photography/tablet-photography.php Passed 13 tests

The main PHP script in "Tablet Photography" version 1.2 is automatically included on every request by WordPress
63 characters long description:
ipad, tablet and smartphones responsivness for native galleries

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
There were no executable files found in this plugin4,666 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript62,1488864,431
CSS23236196
PHP171039

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.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
13 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
colorbox-master/images/ie6/borderTopLeft.png0.35KB0.50KB0.00%
colorbox-master/images/ie6/borderTopRight.png0.45KB0.53KB0.00%
colorbox-master/images/border2.png0.17KB0.16KB▼ 2.35%
photoswipe/icons@2x.png5.32KB3.39KB▼ 36.27%
colorbox-master/images/ie6/borderTopCenter.png0.15KB0.19KB0.00%