first commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Premium\Config;
|
||||
|
||||
use Yoast\WP\SEO\Config\Badge_Group_Names as New_Badge_Group_Names;
|
||||
|
||||
/**
|
||||
* Class Badge_Group_Names.
|
||||
*
|
||||
* This class defines groups for "new" badges, with the version in which those groups are no longer considered
|
||||
* to be "new".
|
||||
*/
|
||||
class Badge_Group_Names extends New_Badge_Group_Names {
|
||||
const GROUP_GLOBAL_TEMPLATES = 'global-templates';
|
||||
|
||||
/**
|
||||
* Constant describing when certain groups of new badges will no longer be shown.
|
||||
*/
|
||||
const GROUP_NAMES = [
|
||||
self::GROUP_GLOBAL_TEMPLATES => '16.5-beta0',
|
||||
];
|
||||
|
||||
/**
|
||||
* Badge_Group_Names constructor.
|
||||
*
|
||||
* @param string $version Optional: the current version number.
|
||||
*/
|
||||
public function __construct( $version = null ) {
|
||||
parent::__construct( $version );
|
||||
|
||||
if ( ! $version ) {
|
||||
$version = \WPSEO_PREMIUM_VERSION;
|
||||
}
|
||||
$this->version = $version;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace Yoast\WP\SEO\Config\Migrations;
|
||||
|
||||
use Yoast\WP\Lib\Migrations\Migration;
|
||||
use Yoast\WP\Lib\Model;
|
||||
|
||||
/**
|
||||
* Class WpYoastPremiumImprovedInternalLinking
|
||||
*
|
||||
* @package Yoast\WP\SEO\Config\Migrations
|
||||
*/
|
||||
class WpYoastPremiumImprovedInternalLinking extends Migration {
|
||||
|
||||
/**
|
||||
* The plugin this migration belongs to.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public static $plugin = 'premium';
|
||||
|
||||
/**
|
||||
* Migration up.
|
||||
*/
|
||||
public function up() {
|
||||
$table_name = $this->get_table_name();
|
||||
$adapter = $this->get_adapter();
|
||||
|
||||
if ( ! $adapter->has_table( $table_name ) ) {
|
||||
$table = $this->create_table( $table_name );
|
||||
|
||||
$table->column(
|
||||
'stem',
|
||||
'string',
|
||||
[
|
||||
'null' => true,
|
||||
'limit' => 191,
|
||||
]
|
||||
);
|
||||
$table->column(
|
||||
'indexable_id',
|
||||
'integer',
|
||||
[
|
||||
'unsigned' => true,
|
||||
'null' => true,
|
||||
'limit' => 11,
|
||||
]
|
||||
);
|
||||
$table->column( 'weight', 'float' );
|
||||
|
||||
$table->finish();
|
||||
}
|
||||
|
||||
if ( ! $adapter->has_index( $table_name, 'stem', [ 'name' => 'stem' ] ) ) {
|
||||
$this->add_index(
|
||||
$table_name,
|
||||
[
|
||||
'stem',
|
||||
],
|
||||
[
|
||||
'name' => 'stem',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! $adapter->has_index( $table_name, 'indexable_id', [ 'name' => 'indexable_id' ] ) ) {
|
||||
$this->add_index(
|
||||
$table_name,
|
||||
[
|
||||
'indexable_id',
|
||||
],
|
||||
[
|
||||
'name' => 'indexable_id',
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migration down.
|
||||
*/
|
||||
public function down() {
|
||||
$table_name = $this->get_table_name();
|
||||
if ( $this->get_adapter()->has_table( $table_name ) ) {
|
||||
$this->drop_table( $table_name );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the table name to use.
|
||||
*
|
||||
* @return string The table name to use.
|
||||
*/
|
||||
protected function get_table_name() {
|
||||
return Model::get_table_name( 'Prominent_Words' );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user