68% ruven-themes-post-formats-ui

Code Review | Ruven Themes: Post Formats UI

WordPress plugin Ruven Themes: Post Formats UI scored68%from 54 tests.

About plugin

  • Plugin page: ruven-themes-post...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.0
  • WordPress version: 6.3.1
  • First release: May 21, 2014
  • Latest release: Sep 5, 2014
  • Number of updates: 4
  • Update frequency: every 28.0 days
  • Top authors: Ruven Themes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,331 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.23MB] [CPU: ▼40.75ms] Passed 4 tests

Analyzing server-side resources used by Ruven Themes: Post Formats UI
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.73 ▼0.7320.08 ▼22.47
Dashboard /wp-admin2.78 ▼0.5216.50 ▼30.97
Posts /wp-admin/edit.php2.78 ▼0.5816.55 ▼31.76
Add New Post /wp-admin/post-new.php2.78 ▼3.1116.95 ▼77.78
Media Library /wp-admin/upload.php2.78 ▼0.4515.53 ▼17.12

Server storage [IO: ▲0.34MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Just a few items left to fix
  • You have illegally modified 2 files (0.00KB) outside of "wp-content/plugins/ruven-themes-post-formats-ui/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/ruven-themes-post-formats-ui/assets/icon-256\303\227256.png"
    • (new file) "wp-content/plugins/ruven-themes-post-formats-ui/assets/icon-128\303\227128.png"
Filesystem: 42 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Ruven Themes: Post Formats UI
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,939 ▲20414.82 ▲0.451.89 ▲0.2640.20 ▲0.72
Dashboard /wp-admin2,345 ▲1576.49 ▲1.66133.30 ▲21.2942.97 ▼4.35
Posts /wp-admin/edit.php2,251 ▲1623.41 ▲1.4149.42 ▲9.2732.93 ▼4.18
Add New Post /wp-admin/post-new.php6,767 ▲5,23120.43 ▼2.75889.51 ▲225.2036.92 ▼21.53
Media Library /wp-admin/upload.php1,390 ▼14.13 ▼0.0684.70 ▼14.4147.26 ▲4.25

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/ruven-themes-post-formats-ui/includes/cmb/init.php+746
    count(): Parameter must be an array or an object that implements Countable
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ruven-themes-post-formats-ui/includes/cmb/tests/phpunit/includes/bootstrap.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ruven-themes-post-formats-ui/includes/cmb/example-functions.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/ruven-themes-post-formats-ui/includes/cmb/init.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/ruven-themes-post-formats-ui/includes/cmb/tests/phpunit/tests/CMB_Core_Test.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ruven-themes-post-formats-ui/ruven-themes-post-formats-ui.php:31

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 Passed 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
2 plugin tags: post formats ui, post formats

ruven-themes-post-formats-ui/ruven-themes-post-formats-ui.php Passed 13 tests

The main PHP script in "Ruven Themes: Post Formats UI" version 1.0 is automatically included on every request by WordPress
69 characters long description:
Extends the functionality of Ruven Themes by adding a Post Formats UI

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
Success! There were no dangerous files found in this plugin5,377 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript63194052,261
PHP105871,1042,162
CSS26121540
Markdown3890289
Bourne Shell115459
JSON10031
YAML15018
XML10117

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity50.75
▷ Minimum class complexity1.00
▷ Maximum class complexity136.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods139
▷ Static methods3424.46%
▷ Public methods13798.56%
▷ Protected methods21.44%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
16 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/cmb/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
includes/cmb/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
includes/cmb/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
includes/cmb/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
includes/cmb/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%