Could Be A Constant

Those literals are assigned then compared somewhere else in the code. When those literals are carrying a state, it is recommended to assign them to a constant, to ensure that both parts of the application use the same values..

LiteralAssignationsComparisons
3
  • $rows = 3
  • $times = 3
  • $times < 3
1000
  • $limit = 1000
  • $value < 1000
200
  • $words_per_minute = 200
  • $limits->status !== 200
  • $response_code === 200
on
  • $val = 'on'
  • $_SERVER['HTTPS'] === 'on'
  • $meta_data['wpseo_noindex_author'] === 'on'
  • $source_options['use_multiple_locations'] === 'on'
  • $value === 'on'
-1
  • $current_filter = '-1'
  • $_GET['cat'] === '-1'
trash
  • $states['trash'] = 'trash'
  • $post_status === 'trash'
  • $rec->post_status !== 'trash'
  • $requested_state !== 'trash'
off
  • $val = 'off'
  • $source_options['multiple_locations_shared_business_info'] === 'off'
url
  • $type = 'url'
  • $attr['type'] === 'url'
  • $field_def['type'] === 'url'
  • $what === 'url'
text
  • $type = 'text'
  • $field_def['type'] === 'text'
yes
  • $yoast_seo_dashicon = 'yes'
  • $_GET['allow_tracking'] === 'yes'
error
  • $yoast_seo_status = 'error'
  • $a_type === 'error'
  • $b_type === 'error'
index
  • $new_robot_value = 'index'
  • $meta_value === 'index'
  • $no_index === 'index'
description
  • $this->meta_key = 'description'
  • $column_name === 'description'
  • $field_name === 'description'
hidden
  • WPSEO_Meta::$meta_fields['advanced']['wordproof_timestamp']['type'] = 'hidden'
  • $field_def['type'] === 'hidden'
  • $meta_field_def['type'] === 'hidden'
noindex
  • $new_robot_value = 'noindex'
  • $option_value[$taxonomy][$term_id][$key] = 'noindex'
  • $robots['index'] = 'noindex'
  • $meta_value === 'noindex'
  • $robots['index'] === 'noindex'
  • $tax_noindex === 'noindex'
  • $value === 'noindex'
wpseo_manage_options
  • $submenu_pages[$index][3] = 'wpseo_manage_options'
  • $capability === 'wpseo_manage_options'
term
  • $indexable->object_type = 'term'
  • $child->object_type === 'term'
  • $context->indexable->object_type === 'term'
  • $indexable->object_type === 'term'
system-page
  • $indexable->object_type = 'system-page'
  • $indexable->object_type === 'system-page'
  • $this->context->indexable->object_type === 'system-page'
user
  • $indexable->object_type = 'user'
  • $indexable->object_type === 'user'
  • $this->context->indexable->object_type === 'user'
unindexed
  • $indexable->post_status = 'unindexed'
  • $ancestor->post_status === 'unindexed'
  • $static_ancestor->post_status !== 'unindexed'
  • $this->permalink === 'unindexed'
post
  • $indexable->object_type = 'post'
  • $post_robot_mapping['subtype'] = 'post'
  • $_SERVER['REQUEST_METHOD'] === 'POST'
  • $context->indexable->object_sub_type !== 'post'
  • $context->indexable->object_type === 'post'
  • $indexable->object_type !== 'post'
  • $indexable->object_type === 'post'
  • $page_type === 'post'
  • $params['slug'] === 'post'
  • $parent !== 'post'
  • $parent === 'post'
  • $post_type === 'post'
  • $pt->name === 'post'
  • $target->object_type === 'post'
  • $this->context->indexable->object_sub_type === 'post'
  • $this->context->indexable->object_type !== 'post'
  • $this->context->indexable->object_type === 'post'
  • $this->model->object_sub_type !== 'post'
  • $this->presentation->model->object_sub_type !== 'post'
  • $this->presentation->model->object_sub_type === 'post'
post-type-archive
  • $indexable->object_type = 'post-type-archive'
  • $indexable->object_type === 'post-type-archive'
updated
  • $yoast_seo_status = 'updated'
  • $settings_errors[0]['type'] === 'updated'
collectionpage
  • $type = 'CollectionPage'
  • $data['@type'] === 'CollectionPage'
0
  • $site_logo_id = '0'
  • $ancestors[0]['ancestor_id'] === '0'
  • $count !== '0'
  • $exists->deleted === '0'
  • $main_taxonomy === '0'
  • $noindex === '0'
  • $result === '0'
/
  • $permalink_parts['path'] = '/'
  • $home_path === '/'
  • $image['url'][0] === '/'
  • $img[0] !== '/'
  • $path !== '/'
  • $src[0] !== '/'
none
  • $robots['max-image-preview'] = 'none'
  • $additional_type === 'None'
  • $this->context->schema_article_type !== 'None'
  • $type === 'None'
full
  • $image['size'] = 'full'
  • $image_size = 'full'
  • $size === 'full'
set-by-user
  • $indexable->open_graph_image_source = 'set-by-user'
  • $indexable->twitter_image_source = 'set-by-user'
  • $source === 'set-by-user'
  • $this->context->indexable->twitter_image_source === 'set-by-user'
home-page
  • $indexable->object_type = 'home-page'
  • $indexable->object_type === 'home-page'
tracking
  • $option_name = 'tracking'
  • $feature_setting === 'tracking'
post_tag
  • $subtype = 'post_tag'
  • $taxonomy === 'post_tag'
default
  • $researcher_language = 'default'
  • $image_type === 'default'
  • $no_index !== 'default'
person
  • $data['@type'] = 'Person'
  • $context->site_represents !== 'person'
  • $this->context->site_represents !== 'person'
  • $this->context->site_represents === 'person'
  • $this->site_represents === 'person'
imported
  • $indexable->$image_source_key = 'imported'
  • $source === 'imported'
tag
  • $taxonomy = 'tag'
  • $subtype === 'tag'
publish
  • $posts['post_status'] = 'publish'
  • $new_status !== 'publish'
1
  • $clean = '1'
  • $site->$state_slug === '1'
  • $type === '1'
utf-8
  • $this->output_charset = 'UTF-8'
  • $this->charset !== 'UTF-8'
category
  • $category_base = 'category'
  • $setting['subtype'] === 'category'
  • $subtype === 'category'
  • $taxonomy !== 'category'
  • $taxonomy === 'category'