88% wp-pexels-free-stock-photos

Code Review | Pexels: Free Stock Photos

WordPress plugin Pexels: Free Stock Photos scored 88% from 54 tests.

About plugin

  • Plugin page: wp-pexels-free-st...
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5.1
  • WordPress version: 5.8.1
  • First release: Mar 19, 2018
  • Latest release: Sep 3, 2020
  • Number of updates: 17
  • Update frequency: every 52.9 days
  • Top authors: raajtram (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

7,000+ active / 38,249 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼141.54ms] Passed 4 tests

An overview of server-side resources used by Pexels: Free Stock Photos
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1436.95 ▲14.46
Dashboard /wp-admin3.09 ▲0.0447.72 ▲0.39
Posts /wp-admin/edit.php3.14 ▲0.0447.15 ▲0.42
Add New Post /wp-admin/post-new.php5.45 ▲0.0192.91 ▼570.89
Media Library /wp-admin/upload.php3.03 ▲0.0339.08 ▲3.91
Pexels Photos /wp-admin/upload.php?page=pexels_fsp_images_settings2.9829.57

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Pexels: Free Stock Photos
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,683 ▲8715.70 ▲0.227.52 ▼1.0946.39 ▼0.95
Dashboard /wp-admin2,997 ▲636.04 ▲0.10140.80 ▼15.38118.89 ▼4.82
Posts /wp-admin/edit.php2,744 ▲52.69 ▲0.0066.58 ▼3.5093.61 ▼0.53
Add New Post /wp-admin/post-new.php1,686 ▲8218.62 ▼0.26383.77 ▼1.81111.53 ▲3.98
Media Library /wp-admin/upload.php1,815 ▲85.03 ▲0.00148.73 ▼5.27129.87 ▲8.18
Pexels Photos /wp-admin/upload.php?page=pexels_fsp_images_settings1,1642.2359.8592.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/upload.php?page=pexels_fsp_images_settings
    • > Notice in wp-content/plugins/wp-pexels-free-stock-photos/settings.php+75
    Undefined index: post_id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=pexels_fsp_images_settings
    • > Notice in wp-content/plugins/wp-pexels-free-stock-photos/settings.php+37
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-pexels-free-stock-photos/settings.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-pexels-free-stock-photos/index.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
9 plugin tags: unsplash, pexels, stock photos, free images, pixabay...

wp-pexels-free-stock-photos/index.php 77% from 13 tests

"Pexels: Free Stock Photos" version 1.2.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 269 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-pexels-free-stock-photos.php" instead of "index.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected233 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP24653215
SVG20018

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/pexels-logo.png4.86KB3.20KB▼ 34.18%