Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix thumbnail not being updated issue #253 #255

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

javmah
Copy link
Contributor

@javmah javmah commented Dec 7, 2022

Thumbnail is not changing from the WordPress media # issue 253

Thumbnail is not changing from the WordPress media  # issue 253
Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpcs scanning turned up:

🚫 195 errors

⚠️ 5 warnings


hashes-api-scanning skipped

Posting will continue in further review(s)

// Video attachment ID.
$postId = (isset($post['ID']) AND !empty($post['ID'])) ? intval( sanitize_text_field($post['ID']) ) : NULL;
// Empty check for thumbnail image file name and post id
if(! $rtMediaSelectedThumbnail OR ! $postId){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$postId" is not in valid snake_case format, try "$post_id" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Video attachment ID.
$postId = (isset($post['ID']) AND !empty($post['ID'])) ? intval( sanitize_text_field($post['ID']) ) : NULL;
// Empty check for thumbnail image file name and post id
if(! $rtMediaSelectedThumbnail OR ! $postId){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space before closing parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis).

// Video attachment ID.
$postId = (isset($post['ID']) AND !empty($post['ID'])) ? intval( sanitize_text_field($post['ID']) ) : NULL;
// Empty check for thumbnail image file name and post id
if(! $rtMediaSelectedThumbnail OR ! $postId){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space(s) after closing parenthesis; found 0 (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis).

// Video attachment ID.
$postId = (isset($post['ID']) AND !empty($post['ID'])) ? intval( sanitize_text_field($post['ID']) ) : NULL;
// Empty check for thumbnail image file name and post id
if(! $rtMediaSelectedThumbnail OR ! $postId){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Space between opening control structure and closing parenthesis is required (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterCloseParenthesis).

}
// === This is old code [legacy code starts] ===
// if rtMedia Plugin is exist Do this block
if (class_exists( 'rtMedia' )){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space after opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis).

}
// === This is old code [legacy code starts] ===
// if rtMedia Plugin is exist Do this block
if (class_exists( 'rtMedia' )){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space before closing parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis).

}
// === This is old code [legacy code starts] ===
// if rtMedia Plugin is exist Do this block
if (class_exists( 'rtMedia' )){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space(s) after closing parenthesis; found 0 (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis).

}
// === This is old code [legacy code starts] ===
// if rtMedia Plugin is exist Do this block
if (class_exists( 'rtMedia' )){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Space between opening control structure and closing parenthesis is required (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterCloseParenthesis).

// === This is old code [legacy code starts] ===
// if rtMedia Plugin is exist Do this block
if (class_exists( 'rtMedia' )){
$uploads = function_exists('wp_get_upload_dir') ? wp_get_upload_dir() : wp_upload_dir();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

// === This is old code [legacy code starts] ===
// if rtMedia Plugin is exist Do this block
if (class_exists( 'rtMedia' )){
$uploads = function_exists('wp_get_upload_dir') ? wp_get_upload_dir() : wp_upload_dir();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

// if rtMedia Plugin is exist Do this block
if (class_exists( 'rtMedia' )){
$uploads = function_exists('wp_get_upload_dir') ? wp_get_upload_dir() : wp_upload_dir();
$final_file_url = (strpos($rtMediaSelectedThumbnail, $uploads['baseurl']) === false) ? $rtMediaSelectedThumbnail : $uploads['baseurl'] . '/' . $rtMediaSelectedThumbnail;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space after open parenthesis; 0 found (Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceAfterOpen).

// if rtMedia Plugin is exist Do this block
if (class_exists( 'rtMedia' )){
$uploads = function_exists('wp_get_upload_dir') ? wp_get_upload_dir() : wp_upload_dir();
$final_file_url = (strpos($rtMediaSelectedThumbnail, $uploads['baseurl']) === false) ? $rtMediaSelectedThumbnail : $uploads['baseurl'] . '/' . $rtMediaSelectedThumbnail;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

// if rtMedia Plugin is exist Do this block
if (class_exists( 'rtMedia' )){
$uploads = function_exists('wp_get_upload_dir') ? wp_get_upload_dir() : wp_upload_dir();
$final_file_url = (strpos($rtMediaSelectedThumbnail, $uploads['baseurl']) === false) ? $rtMediaSelectedThumbnail : $uploads['baseurl'] . '/' . $rtMediaSelectedThumbnail;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

// if rtMedia Plugin is exist Do this block
if (class_exists( 'rtMedia' )){
$uploads = function_exists('wp_get_upload_dir') ? wp_get_upload_dir() : wp_upload_dir();
$final_file_url = (strpos($rtMediaSelectedThumbnail, $uploads['baseurl']) === false) ? $rtMediaSelectedThumbnail : $uploads['baseurl'] . '/' . $rtMediaSelectedThumbnail;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$rtMediaSelectedThumbnail" is not in valid snake_case format, try "$rt_media_selected_thumbnail" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// if rtMedia Plugin is exist Do this block
if (class_exists( 'rtMedia' )){
$uploads = function_exists('wp_get_upload_dir') ? wp_get_upload_dir() : wp_upload_dir();
$final_file_url = (strpos($rtMediaSelectedThumbnail, $uploads['baseurl']) === false) ? $rtMediaSelectedThumbnail : $uploads['baseurl'] . '/' . $rtMediaSelectedThumbnail;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space before close parenthesis; 0 found (Generic.WhiteSpace.ArbitraryParenthesesSpacing.SpaceBeforeClose).

$uploads = function_exists('wp_get_upload_dir') ? wp_get_upload_dir() : wp_upload_dir();
$final_file_url = (strpos($rtMediaSelectedThumbnail, $uploads['baseurl']) === false) ? $rtMediaSelectedThumbnail : $uploads['baseurl'] . '/' . $rtMediaSelectedThumbnail;
$rtmedia_model = new RTMediaModel();
$media = $rtmedia_model->get(array('media_id' => $postId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

$uploads = function_exists('wp_get_upload_dir') ? wp_get_upload_dir() : wp_upload_dir();
$final_file_url = (strpos($rtMediaSelectedThumbnail, $uploads['baseurl']) === false) ? $rtMediaSelectedThumbnail : $uploads['baseurl'] . '/' . $rtMediaSelectedThumbnail;
$rtmedia_model = new RTMediaModel();
$media = $rtmedia_model->get(array('media_id' => $postId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

$uploads = function_exists('wp_get_upload_dir') ? wp_get_upload_dir() : wp_upload_dir();
$final_file_url = (strpos($rtMediaSelectedThumbnail, $uploads['baseurl']) === false) ? $rtMediaSelectedThumbnail : $uploads['baseurl'] . '/' . $rtMediaSelectedThumbnail;
$rtmedia_model = new RTMediaModel();
$media = $rtmedia_model->get(array('media_id' => $postId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Missing space after array opener (WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceAfterArrayOpener).

$uploads = function_exists('wp_get_upload_dir') ? wp_get_upload_dir() : wp_upload_dir();
$final_file_url = (strpos($rtMediaSelectedThumbnail, $uploads['baseurl']) === false) ? $rtMediaSelectedThumbnail : $uploads['baseurl'] . '/' . $rtMediaSelectedThumbnail;
$rtmedia_model = new RTMediaModel();
$media = $rtmedia_model->get(array('media_id' => $postId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$postId" is not in valid snake_case format, try "$post_id" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

$uploads = function_exists('wp_get_upload_dir') ? wp_get_upload_dir() : wp_upload_dir();
$final_file_url = (strpos($rtMediaSelectedThumbnail, $uploads['baseurl']) === false) ? $rtMediaSelectedThumbnail : $uploads['baseurl'] . '/' . $rtMediaSelectedThumbnail;
$rtmedia_model = new RTMediaModel();
$media = $rtmedia_model->get(array('media_id' => $postId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Missing space before array closer (WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceBeforeArrayCloser).

Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

$rtmedia_model = new RTMediaModel();
$media = $rtmedia_model->get(array('media_id' => $postId));
$media_id = $media[0]->id;
$rtmedia_model->update(array('cover_art' => $final_file_url ), array('media_id' => $postId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

$rtmedia_model = new RTMediaModel();
$media = $rtmedia_model->get(array('media_id' => $postId));
$media_id = $media[0]->id;
$rtmedia_model->update(array('cover_art' => $final_file_url ), array('media_id' => $postId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

$rtmedia_model = new RTMediaModel();
$media = $rtmedia_model->get(array('media_id' => $postId));
$media_id = $media[0]->id;
$rtmedia_model->update(array('cover_art' => $final_file_url ), array('media_id' => $postId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Missing space after array opener (WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceAfterArrayOpener).

$rtmedia_model = new RTMediaModel();
$media = $rtmedia_model->get(array('media_id' => $postId));
$media_id = $media[0]->id;
$rtmedia_model->update(array('cover_art' => $final_file_url ), array('media_id' => $postId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$postId" is not in valid snake_case format, try "$post_id" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

$rtmedia_model = new RTMediaModel();
$media = $rtmedia_model->get(array('media_id' => $postId));
$media_id = $media[0]->id;
$rtmedia_model->update(array('cover_art' => $final_file_url ), array('media_id' => $postId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Missing space before array closer (WordPress.Arrays.ArrayDeclarationSpacing.NoSpaceBeforeArrayCloser).

rtt_update_activity_after_thumb_set( $media_id );
}
// Updating post meta.
update_post_meta($postId, '_rt_media_video_thumbnail', $rtMediaSelectedThumbnail);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

rtt_update_activity_after_thumb_set( $media_id );
}
// Updating post meta.
update_post_meta($postId, '_rt_media_video_thumbnail', $rtMediaSelectedThumbnail);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

rtt_update_activity_after_thumb_set( $media_id );
}
// Updating post meta.
update_post_meta($postId, '_rt_media_video_thumbnail', $rtMediaSelectedThumbnail);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$postId" is not in valid snake_case format, try "$post_id" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

rtt_update_activity_after_thumb_set( $media_id );
}
// Updating post meta.
update_post_meta($postId, '_rt_media_video_thumbnail', $rtMediaSelectedThumbnail);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$rtMediaSelectedThumbnail" is not in valid snake_case format, try "$rt_media_selected_thumbnail" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Updating post meta.
update_post_meta($postId, '_rt_media_video_thumbnail', $rtMediaSelectedThumbnail);
// === This is old code [legacy code ends] ===
# I am creating thumbnail entry because when transcoder sent the data it create only first thumbnail of the video
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Perl-style comments are not allowed; use "// Comment" instead (Squiz.Commenting.InlineComment.WrongStyle).

Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

update_post_meta($postId, '_rt_media_video_thumbnail', $rtMediaSelectedThumbnail);
// === This is old code [legacy code ends] ===
# I am creating thumbnail entry because when transcoder sent the data it create only first thumbnail of the video
// Getting all meta File name that was created by this Plugin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

// === This is old code [legacy code ends] ===
# I am creating thumbnail entry because when transcoder sent the data it create only first thumbnail of the video
// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$thumbnailListArray" is not in valid snake_case format, try "$thumbnail_list_array" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// === This is old code [legacy code ends] ===
# I am creating thumbnail entry because when transcoder sent the data it create only first thumbnail of the video
// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

// === This is old code [legacy code ends] ===
# I am creating thumbnail entry because when transcoder sent the data it create only first thumbnail of the video
// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

// === This is old code [legacy code ends] ===
# I am creating thumbnail entry because when transcoder sent the data it create only first thumbnail of the video
// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$postId" is not in valid snake_case format, try "$post_id" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

# I am creating thumbnail entry because when transcoder sent the data it create only first thumbnail of the video
// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space before comment text but found 2; use block comment if you need indentation (Squiz.Commenting.InlineComment.SpacingBefore).

// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Space after opening control structure is required (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterStructureOpen).

// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space before opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeOpenParenthesis).

// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space after opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis).

// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space(s) after IF keyword; 0 found (Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword).

Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space before "!"; 0 found (WordPress.WhiteSpace.OperatorSpacing.NoSpaceBefore).

// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$thumbnailListArray" is not in valid snake_case format, try "$thumbnail_list_array" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: PHP keywords must be lowercase; expected "or" but found "OR" (Generic.PHP.LowerCaseKeyword.Found).

// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Logical operator "or" is prohibited; use "||" instead (Squiz.Operators.ValidLogicalOperators.NotAllowed).

// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space before closing parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis).

// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space(s) after closing parenthesis; found 0 (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis).

// Getting all meta File name that was created by this Plugin
$thumbnailListArray = get_post_meta($postId, '_rt_media_thumbnails', true);
// Check is empty or not array.
if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Space between opening control structure and closing parenthesis is required (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterCloseParenthesis).

if(! is_array($thumbnailListArray) OR empty($thumbnailListArray)){
return $post;
}
// Global database object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

}
// Global database object
global $wpdb;
// Looping the thumbnails array
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

// Global database object
global $wpdb;
// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space after opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis).

// Global database object
global $wpdb;
// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$thumbnailListArray" is not in valid snake_case format, try "$thumbnail_list_array" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Global database object
global $wpdb;
// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$fileLastHalfPath" is not in valid snake_case format, try "$file_last_half_path" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Global database object
global $wpdb;
// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space before closing parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis).

// Global database object
global $wpdb;
// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space(s) after closing parenthesis; found 0 (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis).

// Global database object
global $wpdb;
// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Space between opening control structure and closing parenthesis is required (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterCloseParenthesis).

global $wpdb;
// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
// Running database query to see thumbnail already exist in the database
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
// Running database query to see thumbnail already exist in the database
$firstPreviousEntryID = $wpdb->get_var("SELECT * FROM ".$wpdb->prefix."posts WHERE post_type = 'attachment' AND post_title = '". pathinfo($fileLastHalfPath, PATHINFO_FILENAME) ."'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$firstPreviousEntryID" is not in valid snake_case format, try "$first_previous_entry_i_d" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
// Running database query to see thumbnail already exist in the database
$firstPreviousEntryID = $wpdb->get_var("SELECT * FROM ".$wpdb->prefix."posts WHERE post_type = 'attachment' AND post_title = '". pathinfo($fileLastHalfPath, PATHINFO_FILENAME) ."'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Usage of a direct database call is discouraged (WordPress.DB.DirectDatabaseQuery.DirectQuery).

Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
// Running database query to see thumbnail already exist in the database
$firstPreviousEntryID = $wpdb->get_var("SELECT * FROM ".$wpdb->prefix."posts WHERE post_type = 'attachment' AND post_title = '". pathinfo($fileLastHalfPath, PATHINFO_FILENAME) ."'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete() (WordPress.DB.DirectDatabaseQuery.NoCaching).

// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
// Running database query to see thumbnail already exist in the database
$firstPreviousEntryID = $wpdb->get_var("SELECT * FROM ".$wpdb->prefix."posts WHERE post_type = 'attachment' AND post_title = '". pathinfo($fileLastHalfPath, PATHINFO_FILENAME) ."'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
// Running database query to see thumbnail already exist in the database
$firstPreviousEntryID = $wpdb->get_var("SELECT * FROM ".$wpdb->prefix."posts WHERE post_type = 'attachment' AND post_title = '". pathinfo($fileLastHalfPath, PATHINFO_FILENAME) ."'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
// Running database query to see thumbnail already exist in the database
$firstPreviousEntryID = $wpdb->get_var("SELECT * FROM ".$wpdb->prefix."posts WHERE post_type = 'attachment' AND post_title = '". pathinfo($fileLastHalfPath, PATHINFO_FILENAME) ."'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: String "SELECT * FROM " does not require double quotes; use single quotes instead (Squiz.Strings.DoubleQuoteUsage.NotRequired).

// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
// Running database query to see thumbnail already exist in the database
$firstPreviousEntryID = $wpdb->get_var("SELECT * FROM ".$wpdb->prefix."posts WHERE post_type = 'attachment' AND post_title = '". pathinfo($fileLastHalfPath, PATHINFO_FILENAME) ."'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Concat operator must be surrounded by a single space (Squiz.Strings.ConcatenationSpacing.PaddingFound).

// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
// Running database query to see thumbnail already exist in the database
$firstPreviousEntryID = $wpdb->get_var("SELECT * FROM ".$wpdb->prefix."posts WHERE post_type = 'attachment' AND post_title = '". pathinfo($fileLastHalfPath, PATHINFO_FILENAME) ."'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use placeholders and $wpdb->prepare(); found pathinfo (WordPress.DB.PreparedSQL.NotPrepared).

// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
// Running database query to see thumbnail already exist in the database
$firstPreviousEntryID = $wpdb->get_var("SELECT * FROM ".$wpdb->prefix."posts WHERE post_type = 'attachment' AND post_title = '". pathinfo($fileLastHalfPath, PATHINFO_FILENAME) ."'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use placeholders and $wpdb->prepare(); found $fileLastHalfPath (WordPress.DB.PreparedSQL.NotPrepared).

// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
// Running database query to see thumbnail already exist in the database
$firstPreviousEntryID = $wpdb->get_var("SELECT * FROM ".$wpdb->prefix."posts WHERE post_type = 'attachment' AND post_title = '". pathinfo($fileLastHalfPath, PATHINFO_FILENAME) ."'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$fileLastHalfPath" is not in valid snake_case format, try "$file_last_half_path" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Looping the thumbnails array
foreach ($thumbnailListArray as $fileLastHalfPath){
// Running database query to see thumbnail already exist in the database
$firstPreviousEntryID = $wpdb->get_var("SELECT * FROM ".$wpdb->prefix."posts WHERE post_type = 'attachment' AND post_title = '". pathinfo($fileLastHalfPath, PATHINFO_FILENAME) ."'");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use placeholders and $wpdb->prepare(); found PATHINFO_FILENAME (WordPress.DB.PreparedSQL.NotPrepared).

foreach ($thumbnailListArray as $fileLastHalfPath){
// Running database query to see thumbnail already exist in the database
$firstPreviousEntryID = $wpdb->get_var("SELECT * FROM ".$wpdb->prefix."posts WHERE post_type = 'attachment' AND post_title = '". pathinfo($fileLastHalfPath, PATHINFO_FILENAME) ."'");
// if Thumbnail is not in the database than insert the thubnail to the database
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

Those are style changes that were requested by rtBot
Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpcs scanning turned up:

🚫 186 errors

⚠️ 8 warnings


hashes-api-scanning skipped

Posting will continue in further review(s)

if ( isset( $usage_details[ $this->api_key ]->plan->name ) && ( strtolower( $usage_details[ $this->api_key ]->plan->name ) === strtolower( $name ) ) && $usage_details[ $this->api_key ]->sub_status && ! $force ) {
$form = '<button disabled="disabled" type="submit" class="button button-primary bpm-unsubscribe">' . esc_html__( 'Current Plan', 'transcoder' ) . '</button>';
$form = '<button disabled="disabled" type="submit" class="button button-primary bpm-unsubscribe">' . esc_html__( 'Current Plan', 'transcoder' ) . '</button>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Equals sign not aligned correctly; expected 1 space but found 6 spaces (Generic.Formatting.MultipleStatementAlignment.IncorrectWarning).

return $form;
}

/**
* Display all video thumbnails on attachment edit page.
*
* @since 1.0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: There must be exactly one blank line before the tags in a doc comment (Generic.Commenting.DocComment.SpacingBeforeTags).

* @param array $form_fields An array of attachment form fields.
* @param WP_Post $post The WP_Post attachment object.
* @return array $form_fields
* @param array $form_fields An array of attachment form fields.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Spaces must be used for mid-line alignment; tabs are not allowed (WordPress.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed).

* @param WP_Post $post The WP_Post attachment object.
* @return array $form_fields
* @param array $form_fields An array of attachment form fields.
* @param WP_Post $post The WP_Post attachment object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Spaces must be used for mid-line alignment; tabs are not allowed (WordPress.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed).

* @return array $form_fields
* @param array $form_fields An array of attachment form fields.
* @param WP_Post $post The WP_Post attachment object.
* @return array $form_fields
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Spaces must be used for mid-line alignment; tabs are not allowed (WordPress.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed).

}
public function show_video_thumbnail_in_attachment_edit_page( $form_fields, $post ) {
// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Space after opening control structure is required (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterStructureOpen).

}
public function show_video_thumbnail_in_attachment_edit_page( $form_fields, $post ) {
// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space before opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeOpenParenthesis).

}
public function show_video_thumbnail_in_attachment_edit_page( $form_fields, $post ) {
// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space after opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis).

}
public function show_video_thumbnail_in_attachment_edit_page( $form_fields, $post ) {
// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space(s) after IF keyword; 0 found (Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword).

}
public function show_video_thumbnail_in_attachment_edit_page( $form_fields, $post ) {
// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space before "!"; 0 found (WordPress.WhiteSpace.OperatorSpacing.NoSpaceBefore).

Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

}
public function show_video_thumbnail_in_attachment_edit_page( $form_fields, $post ) {
// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

}
public function show_video_thumbnail_in_attachment_edit_page( $form_fields, $post ) {
// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

}
public function show_video_thumbnail_in_attachment_edit_page( $form_fields, $post ) {
// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: PHP keywords must be lowercase; expected "or" but found "OR" (Generic.PHP.LowerCaseKeyword.Found).

}
public function show_video_thumbnail_in_attachment_edit_page( $form_fields, $post ) {
// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Logical operator "or" is prohibited; use "||" instead (Squiz.Operators.ValidLogicalOperators.NotAllowed).

}
public function show_video_thumbnail_in_attachment_edit_page( $form_fields, $post ) {
// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Use Yoda Condition checks, you must (WordPress.PHP.YodaConditions.NotYoda).

}
public function show_video_thumbnail_in_attachment_edit_page( $form_fields, $post ) {
// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space(s) after closing parenthesis; found 0 (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis).

}
public function show_video_thumbnail_in_attachment_edit_page( $form_fields, $post ) {
// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Space between opening control structure and closing parenthesis is required (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterCloseParenthesis).

public function show_video_thumbnail_in_attachment_edit_page( $form_fields, $post ) {
// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
return $form_fields;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

// If post mime type is not video, this feature is only for videos.
if(! isset(explode( '/', $post->post_mime_type)[0]) OR explode('/', $post->post_mime_type)[0] !== 'video' ){
return $form_fields;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed).

return $form_fields;
}
// Getting attachment thumbnail list that was created by our Plugin.
$thumbnailArray = get_post_meta( $post->ID, '_rt_media_thumbnails', true );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$thumbnailArray" is not in valid snake_case format, try "$thumbnail_array" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

// Getting attachment thumbnail list that was created by our Plugin.
$thumbnailArray = get_post_meta( $post->ID, '_rt_media_thumbnails', true );
// Getting option.
$thumbnailArray = empty( $thumbnailArray ) ? get_post_meta( $post->ID, 'rtmedia_media_thumbnails', true ) : $thumbnailArray;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$thumbnailArray" is not in valid snake_case format, try "$thumbnail_array" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Getting option.
$thumbnailArray = empty( $thumbnailArray ) ? get_post_meta( $post->ID, 'rtmedia_media_thumbnails', true ) : $thumbnailArray;
// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$preSelectedThumbnail" is not in valid snake_case format, try "$pre_selected_thumbnail" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Getting option.
$thumbnailArray = empty( $thumbnailArray ) ? get_post_meta( $post->ID, 'rtmedia_media_thumbnails', true ) : $thumbnailArray;
// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

// Getting option.
$thumbnailArray = empty( $thumbnailArray ) ? get_post_meta( $post->ID, 'rtmedia_media_thumbnails', true ) : $thumbnailArray;
// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

$thumbnailArray = empty( $thumbnailArray ) ? get_post_meta( $post->ID, 'rtmedia_media_thumbnails', true ) : $thumbnailArray;
// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
// checking thumbnail Array is array and not empty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
// checking thumbnail Array is array and not empty
if(! is_array( $thumbnailArray ) OR empty( $thumbnailArray ) ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Space after opening control structure is required (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterStructureOpen).

// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
// checking thumbnail Array is array and not empty
if(! is_array( $thumbnailArray ) OR empty( $thumbnailArray ) ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space before opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeOpenParenthesis).

// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
// checking thumbnail Array is array and not empty
if(! is_array( $thumbnailArray ) OR empty( $thumbnailArray ) ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: No space after opening parenthesis is prohibited (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis).

// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
// checking thumbnail Array is array and not empty
if(! is_array( $thumbnailArray ) OR empty( $thumbnailArray ) ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space(s) after IF keyword; 0 found (Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword).

// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
// checking thumbnail Array is array and not empty
if(! is_array( $thumbnailArray ) OR empty( $thumbnailArray ) ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space before "!"; 0 found (WordPress.WhiteSpace.OperatorSpacing.NoSpaceBefore).

Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
// checking thumbnail Array is array and not empty
if(! is_array( $thumbnailArray ) OR empty( $thumbnailArray ) ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$thumbnailArray" is not in valid snake_case format, try "$thumbnail_array" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
// checking thumbnail Array is array and not empty
if(! is_array( $thumbnailArray ) OR empty( $thumbnailArray ) ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: PHP keywords must be lowercase; expected "or" but found "OR" (Generic.PHP.LowerCaseKeyword.Found).

// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
// checking thumbnail Array is array and not empty
if(! is_array( $thumbnailArray ) OR empty( $thumbnailArray ) ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Logical operator "or" is prohibited; use "||" instead (Squiz.Operators.ValidLogicalOperators.NotAllowed).

// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
// checking thumbnail Array is array and not empty
if(! is_array( $thumbnailArray ) OR empty( $thumbnailArray ) ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 space(s) after closing parenthesis; found 0 (Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis).

// Saved or selected thumbnail is that was saved in attachment option.
$preSelectedThumbnail = get_post_meta($post->ID, '_rt_media_video_thumbnail', true);
// checking thumbnail Array is array and not empty
if(! is_array( $thumbnailArray ) OR empty( $thumbnailArray ) ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Space between opening control structure and closing parenthesis is required (WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterCloseParenthesis).

// Backward compatibility.
$uploads = function_exists( 'wp_get_upload_dir' ) ? wp_get_upload_dir() : wp_upload_dir();
// HTML buffer holder.
$htmlString = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$htmlString" is not in valid snake_case format, try "$html_string" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Backward compatibility.
$uploads = function_exists( 'wp_get_upload_dir' ) ? wp_get_upload_dir() : wp_upload_dir();
// HTML buffer holder.
$htmlString = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Warning: Equals sign not aligned correctly; expected 1 space but found 2 spaces (Generic.Formatting.MultipleStatementAlignment.IncorrectWarning).

// Backward compatibility.
$uploads = function_exists( 'wp_get_upload_dir' ) ? wp_get_upload_dir() : wp_upload_dir();
// HTML buffer holder.
$htmlString = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: String "" does not require double quotes; use single quotes instead (Squiz.Strings.DoubleQuoteUsage.NotRequired).

// HTML buffer holder.
$htmlString = "";
// Creating HTML output buffering, starts.
$htmlString .= "<ul>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$htmlString" is not in valid snake_case format, try "$html_string" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// HTML buffer holder.
$htmlString = "";
// Creating HTML output buffering, starts.
$htmlString .= "<ul>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: String "<ul>" does not require double quotes; use single quotes instead (Squiz.Strings.DoubleQuoteUsage.NotRequired).

Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

// Creating HTML output buffering, starts.
$htmlString .= "<ul>";
// Looping the thumbnail array.
foreach ( $thumbnailArray as $key => $thumbnailLink ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$thumbnailArray" is not in valid snake_case format, try "$thumbnail_array" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Creating HTML output buffering, starts.
$htmlString .= "<ul>";
// Looping the thumbnail array.
foreach ( $thumbnailArray as $key => $thumbnailLink ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$thumbnailLink" is not in valid snake_case format, try "$thumbnail_link" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Looping the thumbnail array.
foreach ( $thumbnailArray as $key => $thumbnailLink ) {
// Checked status.
$preSelectionStatus = ( $thumbnailLink === $preSelectedThumbnail ) ? 'checked=checked' : '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$preSelectionStatus" is not in valid snake_case format, try "$pre_selection_status" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Looping the thumbnail array.
foreach ( $thumbnailArray as $key => $thumbnailLink ) {
// Checked status.
$preSelectionStatus = ( $thumbnailLink === $preSelectedThumbnail ) ? 'checked=checked' : '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$thumbnailLink" is not in valid snake_case format, try "$thumbnail_link" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Looping the thumbnail array.
foreach ( $thumbnailArray as $key => $thumbnailLink ) {
// Checked status.
$preSelectionStatus = ( $thumbnailLink === $preSelectedThumbnail ) ? 'checked=checked' : '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$preSelectedThumbnail" is not in valid snake_case format, try "$pre_selected_thumbnail" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// Checked status.
$preSelectionStatus = ( $thumbnailLink === $preSelectedThumbnail ) ? 'checked=checked' : '';
// String concatenation.
$htmlString .= "<li style='width: 150px;display: inline-block;'>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$htmlString" is not in valid snake_case format, try "$html_string" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

$preSelectionStatus = ( $thumbnailLink === $preSelectedThumbnail ) ? 'checked=checked' : '';
// String concatenation.
$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$htmlString" is not in valid snake_case format, try "$html_string" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

$preSelectionStatus = ( $thumbnailLink === $preSelectedThumbnail ) ? 'checked=checked' : '';
// String concatenation.
$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

$preSelectionStatus = ( $thumbnailLink === $preSelectedThumbnail ) ? 'checked=checked' : '';
// String concatenation.
$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

// String concatenation.
$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$htmlString" is not in valid snake_case format, try "$html_string" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

// String concatenation.
$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Concat operator must be surrounded by a single space (Squiz.Strings.ConcatenationSpacing.PaddingFound).

// String concatenation.
$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$preSelectionStatus" is not in valid snake_case format, try "$pre_selection_status" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

// String concatenation.
$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

// String concatenation.
$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

// String concatenation.
$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$thumbnailLink" is not in valid snake_case format, try "$thumbnail_link" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
$htmlString .= "<img src='". esc_url($uploads['baseurl'] .'/'. $thumbnailLink) ."' style='max-height: 120px;max-width: 120px; vertical-align: middle;'/>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$htmlString" is not in valid snake_case format, try "$html_string" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
$htmlString .= "<img src='". esc_url($uploads['baseurl'] .'/'. $thumbnailLink) ."' style='max-height: 120px;max-width: 120px; vertical-align: middle;'/>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Concat operator must be surrounded by a single space (Squiz.Strings.ConcatenationSpacing.PaddingFound).

$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
$htmlString .= "<img src='". esc_url($uploads['baseurl'] .'/'. $thumbnailLink) ."' style='max-height: 120px;max-width: 120px; vertical-align: middle;'/>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces after opening parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket).

$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
$htmlString .= "<img src='". esc_url($uploads['baseurl'] .'/'. $thumbnailLink) ."' style='max-height: 120px;max-width: 120px; vertical-align: middle;'/>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Expected 1 spaces before closing parenthesis; 0 found (PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket).

$htmlString .= "<li style='width: 150px;display: inline-block;'>";
$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
$htmlString .= "<img src='". esc_url($uploads['baseurl'] .'/'. $thumbnailLink) ."' style='max-height: 120px;max-width: 120px; vertical-align: middle;'/>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$thumbnailLink" is not in valid snake_case format, try "$thumbnail_link" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

Copy link
Contributor

@rtBot rtBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous scan continued.

$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
$htmlString .= "<img src='". esc_url($uploads['baseurl'] .'/'. $thumbnailLink) ."' style='max-height: 120px;max-width: 120px; vertical-align: middle;'/>";
$htmlString .= "</label></li>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$htmlString" is not in valid snake_case format, try "$html_string" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

$htmlString .= "<label for='rtmedia-upload-select-thumbnail-'" . esc_attr($key + 1) . "'>";
$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
$htmlString .= "<img src='". esc_url($uploads['baseurl'] .'/'. $thumbnailLink) ."' style='max-height: 120px;max-width: 120px; vertical-align: middle;'/>";
$htmlString .= "</label></li>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: String "</label></li>" does not require double quotes; use single quotes instead (Squiz.Strings.DoubleQuoteUsage.NotRequired).

$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
$htmlString .= "<img src='". esc_url($uploads['baseurl'] .'/'. $thumbnailLink) ."' style='max-height: 120px;max-width: 120px; vertical-align: middle;'/>";
$htmlString .= "</label></li>";
$htmlString .= "</li>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$htmlString" is not in valid snake_case format, try "$html_string" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

$htmlString .= "<input type='checkbox'". $preSelectionStatus ." onclick='yepShowAlert(this)' id='rtmedia-upload-select-thumbnail-". esc_attr($key + 1) ."' value='". esc_attr($thumbnailLink) ."' class='rtEditThumbnail' name='rtmedia-thumbnail' />";
$htmlString .= "<img src='". esc_url($uploads['baseurl'] .'/'. $thumbnailLink) ."' style='max-height: 120px;max-width: 120px; vertical-align: middle;'/>";
$htmlString .= "</label></li>";
$htmlString .= "</li>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: String "</li>" does not require double quotes; use single quotes instead (Squiz.Strings.DoubleQuoteUsage.NotRequired).

}

// HTML output buffering ends.
$htmlString .= '</ul>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$htmlString" is not in valid snake_case format, try "$html_string" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

$form_fields['rtmedia_video_thumbnail'] = array(
'label' => 'Video Thumbnails',
'input' => 'html',
'html' => $htmlString,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Variable "$htmlString" is not in valid snake_case format, try "$html_string" (WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase).

'input' => 'html',
'html' => $htmlString,
);
// Return parameter array value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar).

* Save selected video thumbnail in attachment meta.
* Selected thumbnail use as cover art for buddypress activity if video was uploaded in activity.
*
* this is a process function of show_video_thumbnail_in_attachment_edit_page() function.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Doc comment short description must start with a capital letter (Generic.Commenting.DocComment.ShortNotCapital).

* This function will process show_video_thumbnail_in_attachment_edit_page() selections and create thumbnail if necessary.
* This Function also Save selected video thumbnail in attachment meta in attached video file.
* This Function will also connected to rtMedia Plugin.
* Selected thumbnail use as cover art for buddyPress activity if video was uploaded in activity.
* @since 1.0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: There must be exactly one blank line before the tags in a doc comment (Generic.Commenting.DocComment.SpacingBeforeTags).

*
* @param array $post An array of post data.
* @return array $form_fields
* @param array $post An array of post data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Error: Spaces must be used for mid-line alignment; tabs are not allowed (WordPress.WhiteSpace.DisallowInlineTabs.NonIndentTabsUsed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants