78% array-partition

Code Review | array_partition

WordPress plugin array_partition scored78%from 54 tests.

About plugin

  • Plugin page: array-partition
  • Plugin version: 1.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 1.2-6.3
  • WordPress version: 6.3.1
  • First release: Jun 11, 2009
  • Latest release: Aug 22, 2023
  • Number of updates: 29
  • Update frequency: every 179.3 days
  • Top authors: coffee2code (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,867 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.80ms] Passed 4 tests

Server-side resources used by array_partition
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.48 ▼1.71
Dashboard /wp-admin3.31 ▲0.0149.14 ▼10.69
Posts /wp-admin/edit.php3.36 ▲0.0153.50 ▲1.32
Add New Post /wp-admin/post-new.php5.89 ▲0.0195.03 ▲0.51
Media Library /wp-admin/upload.php3.23 ▲0.0037.61 ▲0.68

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

array_partition: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.77 ▲0.391.94 ▼0.0743.39 ▼0.36
Dashboard /wp-admin2,206 ▲215.80 ▲0.66103.17 ▼2.9141.69 ▼0.20
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0440.24 ▲1.6634.35 ▼1.04
Add New Post /wp-admin/post-new.php1,514 ▼017.49 ▼0.02657.42 ▼6.7852.37 ▼7.28
Media Library /wp-admin/upload.php1,385 ▼34.20 ▼0.01100.11 ▼2.8846.62 ▲1.69

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/array-partition/tests/phpunit/bootstrap.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/array-partition/tests/phpunit/bootstrap.php on line 29
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/array-partition/tests/phpunit/bootstrap.php on line 29

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
7 plugin tags: partitions, columns, partitioning, coffee2code, chunk...

array-partition/array_partition.php 92% from 13 tests

The entry point to "array_partition" version 1.3.3 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("array-partition.php" instead of "array_partition.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected271 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
Markdown2410142
PHP3357694
Bourne Shell16221
XML10014

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.10
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods770.00%
▷ Protected methods330.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG images were found in this plugin