84% find-posts-using-attachment

Code Review | Find Posts Using Attachment

WordPress plugin Find Posts Using Attachment scored84%from 54 tests.

About plugin

  • Plugin page: find-posts-using-...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.8
  • WordPress version: 6.3.1
  • First release: Aug 20, 2014
  • Latest release: Jun 1, 2021
  • Number of updates: 19
  • Update frequency: every 130.4 days
  • Top authors: SergeyBiryukov (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

1,000+ active /10,875 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.02MB] [CPU: ▼6.78ms] Passed 4 tests

Server-side resources used by Find Posts Using Attachment
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.87 ▼0.91
Dashboard /wp-admin3.33 ▼0.0150.18 ▼12.05
Posts /wp-admin/edit.php3.38 ▲0.0345.16 ▼3.30
Add New Post /wp-admin/post-new.php5.91 ▲0.0380.95 ▼10.87
Media Library /wp-admin/upload.php3.25 ▲0.0335.32 ▲2.90

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Find Posts Using Attachment
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.38 ▼0.331.96 ▲0.2842.95 ▲3.11
Dashboard /wp-admin2,189 ▲155.51 ▼0.0685.05 ▼18.0340.98 ▼4.91
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0235.99 ▼4.0635.32 ▲2.87
Add New Post /wp-admin/post-new.php1,526 ▼022.74 ▼0.68597.37 ▼33.8371.87 ▲3.21
Media Library /wp-admin/upload.php1,400 ▼04.14 ▼0.0294.97 ▼13.1741.06 ▼1.31

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% 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 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/find-posts-using-attachment/find-posts-using-attachment.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues 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
4 plugin tags: posts, attachment, image, media

find-posts-using-attachment/find-posts-using-attachment.php Passed 13 tests

Analyzing the main PHP file in "Find Posts Using Attachment" version 1.0
84 characters long description:
Allows to find all posts where a particular attachment (image, video, etc.) is used.

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 detected122 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1379122

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity3.71
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There were not PNG files found in your plugin