Skip to content

Commit

Permalink
made sure solr inxeing works
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Alberto committed Nov 6, 2019
1 parent 19adcd4 commit 3dc1378
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
4 changes: 4 additions & 0 deletions includes/class-tika-doc-pdf-indexer-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,7 @@ function tdpi_save_tika_meta( $post_id, $post ) {
// make the upload file required
// default to upload and restric from selcting uploaded file or the recent file should be indexed.
// Settings should file checks if correct or existing..

// Deploy phpcs runners
// use php unit testing
// minimize ignore
16 changes: 8 additions & 8 deletions includes/class-tika-doc-pdf-indexer-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Tika_Doc_PDF_Indexer_Settings {
*
* @var object
* @access private
* @since 1.0.0
* @since 1.0.1
*/
private static $instance = null; //phpcs:ignore

Expand All @@ -28,7 +28,7 @@ class Tika_Doc_PDF_Indexer_Settings {
*
* @var object
* @access public
* @since 1.0.0
* @since 1.0.1
*/
public $parent = null;

Expand All @@ -37,7 +37,7 @@ class Tika_Doc_PDF_Indexer_Settings {
*
* @var string
* @access public
* @since 1.0.0
* @since 1.0.1
*/
public $base = '';

Expand All @@ -46,7 +46,7 @@ class Tika_Doc_PDF_Indexer_Settings {
*
* @var array
* @access public
* @since 1.0.0
* @since 1.0.1
*/
public $settings = array();

Expand Down Expand Up @@ -194,7 +194,7 @@ public function settings_assets() {
// If you're not including an image upload then you can leave this function call out.
wp_enqueue_media();

wp_register_script( $this->parent->_token . '-settings-js', $this->parent->assets_url . 'js/settings' . $this->parent->script_suffix . '.js', array( 'farbtastic', 'jquery' ), '1.0.0', true );
wp_register_script( $this->parent->_token . '-settings-js', $this->parent->assets_url . 'js/settings' . $this->parent->script_suffix . '.js', array( 'farbtastic', 'jquery' ), '1.0.1', true );
wp_enqueue_script( $this->parent->_token . '-settings-js' );
}

Expand Down Expand Up @@ -386,7 +386,7 @@ public function settings_page() {
*
* Ensures only one instance of Tika_Doc_PDF_Indexer_Settings is loaded or can be loaded.
*
* @since 1.0.0
* @since 1.0.1
* @static
* @see Tika_Doc_PDF_Indexer()
* @param object $parent Object instance.
Expand All @@ -402,7 +402,7 @@ public static function instance( $parent ) {
/**
* Cloning is forbidden.
*
* @since 1.0.0
* @since 1.0.1
*/
public function __clone() {
_doing_it_wrong( __FUNCTION__, esc_html( __( 'Cheatin’ huh?' ), $this->parent->_version ) );
Expand All @@ -411,7 +411,7 @@ public function __clone() {
/**
* Unserializing instances of this class is forbidden.
*
* @since 1.0.0
* @since 1.0.1
*/
public function __wakeup() {
_doing_it_wrong( __FUNCTION__, esc_html( __( 'Cheatin’ huh?' ), $this->parent->_version ) );
Expand Down
2 changes: 1 addition & 1 deletion includes/class-tika-doc-pdf-indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public function enable_doc_cpt() {
* @param string $file File constructor.
* @param string $version Plugin version.
*/
public function __construct( $file = '', $version = '1.0.3' ) {
public function __construct( $file = '', $version = '1.0.4' ) {
$this->_version = $version;
$this->_token = 'tika_doc_pdf_indexer';

Expand Down
2 changes: 2 additions & 0 deletions includes/lib/class-tika-doc-pdf-indexer-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public function register_post_type() {
*/
public function updated_messages( $messages = array() ) {
global $post, $post_ID;
//phpcs:disable
$messages[ $this->post_type ] = array(
0 => '',
1 => sprintf( __( '%1$s updated. %2$sView %3$s%4$s.', 'tika-doc-pdf-indexer' ), $this->single, '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', $this->single, '</a>' ),
Expand All @@ -172,6 +173,7 @@ public function updated_messages( $messages = array() ) {
9 => sprintf( __( '%1$s scheduled for: %2$s. %3$sPreview %4$s%5$s.', 'tika-doc-pdf-indexer' ), $this->single, '<strong>' . date_i18n( __( 'M j, Y @ G:i', 'tika-doc-pdf-indexer' ), strtotime( $post->post_date ) ) . '</strong>', '<a target="_blank" href="' . esc_url( get_permalink( $post_ID ) ) . '">', $this->single, '</a>' ),
10 => sprintf( __( '%1$s draft updated. %2$sPreview %3$s%4$s.', 'tika-doc-pdf-indexer' ), $this->single, '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', $this->single, '</a>' ),
);
//phpcs:enable

return $messages;
}
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: carl-alberto
Tags: wordpress, plugin
Requires at least: 4.8
Tested up to: 5.2.3
Stable tag: 1.0.3
Stable tag: 1.0.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -32,6 +32,10 @@ After plugin installation:

== Changelog ==

= 1.0.4 =
* 2019-11-6
* Made sure that pdf attachments when uploaded are indexed by the WP Solr plugin

= 1.0.0 =
* 2019-10-21
* Initial release
Expand Down
4 changes: 2 additions & 2 deletions tika-doc-pdf-indexer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Plugin Name: Tika Doc PDF indexer
* Version: 1.0.2
* Version: 1.0.4
* Plugin URI: https://wordpress.org/plugins/tika-odc-pdf-indexer/
* Description: This indexes your Docs or PDFs into meta datas when uploaded. Based on Apache Tika.
* Author: Carl Alberto
Expand Down Expand Up @@ -53,7 +53,7 @@
* @return object Tika_Doc_PDF_Indexer
*/
function tika_doc_pdf_indexer() {
$instance = Tika_Doc_PDF_Indexer::instance( __FILE__, '1.0.3' );
$instance = Tika_Doc_PDF_Indexer::instance( __FILE__, '1.0.4' );

if ( is_null( $instance->settings ) ) {
$instance->settings = Tika_Doc_PDF_Indexer_Settings::instance( $instance );
Expand Down

0 comments on commit 3dc1378

Please sign in to comment.