79% set-all-first-images-as-featured

Code Review | Set All First Images As Featured

WordPress plugin Set All First Images As Featured scored79%from 54 tests.

About plugin

  • Plugin page: set-all-first-ima...
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-3.9.1
  • WordPress version: 6.3.1
  • First release: Jun 25, 2014
  • Latest release: Jun 29, 2014
  • Number of updates: 12
  • Update frequency: every 0.3 days
  • Top authors: lucymtc (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

1,000+ active /20,144 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

This is a short check of server-side resources used by Set All First Images As Featured
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.41 ▼3.60
Dashboard /wp-admin3.37 ▲0.0648.88 ▲1.83
Posts /wp-admin/edit.php3.48 ▲0.1251.57 ▼0.21
Add New Post /wp-admin/post-new.php5.95 ▲0.0699.43 ▲3.36
Media Library /wp-admin/upload.php3.29 ▲0.0636.30 ▲1.20
First images as featured /wp-admin/tools.php?page=sfif-options3.2733.63

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Set All First Images As Featured
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.48 ▲0.081.71 ▼0.1042.18 ▼7.96
Dashboard /wp-admin2,210 ▲224.88 ▼0.0398.17 ▼2.3739.42 ▼3.66
Posts /wp-admin/edit.php2,090 ▲12.00 ▲0.0139.43 ▼4.6834.72 ▼2.21
Add New Post /wp-admin/post-new.php1,517 ▼1817.60 ▼3.66626.50 ▼23.6163.51 ▲15.76
Media Library /wp-admin/upload.php1,392 ▲74.25 ▲0.0395.23 ▼24.9639.43 ▼5.96
First images as featured /wp-admin/tools.php?page=sfif-options9262.0826.1732.30

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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 items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/set-all-first-images-as-featured/includes/views/admin-options-page.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/tools.php?page=sfif-options
    • > Network (severe)
    wp-content/plugins/set-all-first-images-as-featured//includes/images/ajax-loader-xs.gif - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
1 plugin tags: featured images

set-all-first-images-as-featured/set-all-first-images-as-featured.php Passed 13 tests

The entry point to "Set All First Images As Featured" version 1.2.2 is a PHP file that has certain tags in its header comment area
85 characters long description:
Sets the first image of your posts, pages or custom post types as the featured image.

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
No dangerous file extensions were detected589 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP3222113317
PO File25658169
CSS115052
JavaScript1371451

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity11.50
▷ Minimum class complexity6.00
▷ Maximum class complexity17.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods17
▷ Static methods1270.59%
▷ Public methods1058.82%
▷ Protected methods317.65%
▷ Private methods423.53%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin