84% picturefillwp

Code Review | Picturefill.WP

WordPress plugin Picturefill.WP scored84%from 54 tests.

About plugin

  • Plugin page: picturefillwp
  • Plugin version: 1.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.9.1
  • WordPress version: 6.3.1
  • First release: Apr 17, 2013
  • Latest release: Aug 4, 2014
  • Number of updates: 46
  • Update frequency: every 10.3 days
  • Top authors: kylereicks (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

90+ active /8,724 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
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▲0.41ms] Passed 4 tests

This is a short check of server-side resources used by Picturefill.WP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1645.88 ▲1.68
Dashboard /wp-admin3.39 ▲0.0851.10 ▼3.03
Posts /wp-admin/edit.php3.50 ▲0.1450.76 ▲2.71
Add New Post /wp-admin/post-new.php6.00 ▲0.1195.13 ▲5.02
Media Library /wp-admin/upload.php3.31 ▲0.0840.10 ▲0.28

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
picturefill_wp_update_timestamp
picturefill_wp_version
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Picturefill.WP: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.18 ▼1.401.61 ▼0.5640.46 ▼7.10
Dashboard /wp-admin2,203 ▲125.85 ▲0.91110.49 ▼7.0142.54 ▼1.58
Posts /wp-admin/edit.php2,086 ▼32.00 ▼0.0139.07 ▲2.8534.76 ▼0.24
Add New Post /wp-admin/post-new.php1,538 ▲2423.34 ▲5.72595.18 ▼86.1062.72 ▲9.48
Media Library /wp-admin/upload.php1,391 ▲34.25 ▼0.0395.90 ▼11.1440.04 ▼6.18

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

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 no errors were found, 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 items
  • 15× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_picture_attribute_string() on null in wp-content/plugins/picturefillwp/inc/templates/min/picture-template.php:1
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_image_src() on null in wp-content/plugins/picturefillwp/inc/templates/source-template.php:1
    • > PHP Notice
      Undefined variable: view_picturefill_wp in wp-content/plugins/picturefillwp/inc/templates/picture-template.php on line 1
    • > PHP Notice
      Undefined variable: view_picturefill_wp in wp-content/plugins/picturefillwp/inc/templates/noscript-template.php on line 1
    • > PHP Notice
      Undefined variable: view_picturefill_wp in wp-content/plugins/picturefillwp/inc/templates/fallback-source-template.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_original_image_src() on null in wp-content/plugins/picturefillwp/inc/templates/fallback-source-template.php:1
    • > PHP Notice
      Undefined variable: view_picturefill_wp in wp-content/plugins/picturefillwp/inc/templates/min/source-template.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_image_src() on null in wp-content/plugins/picturefillwp/inc/templates/min/source-template.php:1
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_picture_attribute_string() on null in wp-content/plugins/picturefillwp/inc/templates/picture-template.php:1
    • > PHP Fatal error
      require_once(): Failed opening required 'PICTUREFILL_WP_PATHinc/class-picturefill-wp.php' (include_path='.:/usr/share/php') in wp-content/plugins/picturefillwp/inc/functions-picturefill-wp.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
8 plugin tags: picturefilljs, responsive images, high dpi, hdpi, retina...

picturefillwp/picturefill-wp.php 92% from 13 tests

"Picturefill.WP" version 1.3.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("picturefillwp.php" instead of "picturefill-wp.php")

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
Success! There were no dangerous files found in this plugin768 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP1214026711
JavaScript212857

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity26.25
▷ Minimum class complexity12.00
▷ Maximum class complexity49.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods66
▷ Static methods1218.18%
▷ Public methods5583.33%
▷ Protected methods00.00%
▷ Private methods1116.67%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
There are no PNG files in this plugin