Changeset 3205064
- Timestamp:
- 12/09/2024 06:05:01 PM (16 months ago)
- Location:
- solr-power
- Files:
-
- 2 added
- 22 edited
- 1 copied
-
tags/2.6.0 (copied) (copied from solr-power/trunk)
-
tags/2.6.0/CHANGELOG.md (modified) (1 diff)
-
tags/2.6.0/assets/css/admin.css (modified) (6 diffs)
-
tags/2.6.0/assets/css/admin.css.map (modified) (1 diff)
-
tags/2.6.0/assets/css/facet.css (modified) (3 diffs)
-
tags/2.6.0/assets/css/facet.css.map (modified) (1 diff)
-
tags/2.6.0/catalog-info.yaml (added)
-
tags/2.6.0/includes/class-solrpower-api.php (modified) (4 diffs)
-
tags/2.6.0/includes/class-solrpower-wp-query.php (modified) (1 diff)
-
tags/2.6.0/readme.txt (modified) (4 diffs)
-
tags/2.6.0/solr-power.php (modified) (2 diffs)
-
tags/2.6.0/vendor/composer/installed.php (modified) (2 diffs)
-
tags/2.6.0/views/options/action.php (modified) (1 diff)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/assets/css/admin.css (modified) (6 diffs)
-
trunk/assets/css/admin.css.map (modified) (1 diff)
-
trunk/assets/css/facet.css (modified) (3 diffs)
-
trunk/assets/css/facet.css.map (modified) (1 diff)
-
trunk/catalog-info.yaml (added)
-
trunk/includes/class-solrpower-api.php (modified) (4 diffs)
-
trunk/includes/class-solrpower-wp-query.php (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/solr-power.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/views/options/action.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
solr-power/tags/2.6.0/CHANGELOG.md
r3076702 r3205064 1 1 ## Changelog ## 2 3 ### 2.6.0 (December 05, 2024) ### 4 * Adds `is_solr_query` filter [[#588](https://github.com/pantheon-systems/solr-power/pull/588)] (props [@sboisvert](https://github.com/sboisvert)) 5 * Fixes custom schema file path for Composer Managed and other non-standard uploads directories. [[#637](https://github.com/pantheon-systems/solr-power/pull/637)] 6 * Adds filter `solr_power_customer_schema_file_path` to specify an alternative custom schema.xml file. [[#637](https://github.com/pantheon-systems/solr-power/pull/637)] 2 7 3 8 ### 2.5.3 (April 24, 2024) ### -
solr-power/tags/2.6.0/assets/css/admin.css
r2896399 r3205064 1 1 .solrtab { 2 display: none; } 3 .solrtab.active { 4 display: -ms-flexbox; 5 display: flex; 6 -ms-flex-wrap: wrap; 7 flex-wrap: wrap; 8 background: #fff; 9 padding: 20px; } 10 .solrtab .solr-display { 11 width: 50%; 12 float: left; 13 display: -ms-flexbox; 14 display: flex; } 15 .solrtab .solr-display div { 16 width: 100%; 17 padding: 20px; 18 border: 1px solid #c0c0c0; } 19 .solrtab .solr-display div h3 { 20 border-bottom: 1px solid #c0c0c0; 21 margin: 0; } 22 .solrtab .solr-display div ul li { 23 display: -ms-flexbox; 24 display: flex; 25 -ms-flex-wrap: wrap; 26 flex-wrap: wrap; 27 border-bottom: 1px dotted #c0c0c0; } 28 .solrtab .solr-display div ul li strong { 29 width: 50%; 30 display: -ms-flexbox; 31 display: flex; } 2 display: none; 3 } 4 .solrtab.active { 5 display: -ms-flexbox; 6 display: flex; 7 -ms-flex-wrap: wrap; 8 flex-wrap: wrap; 9 background: #fff; 10 padding: 20px; 11 } 12 .solrtab .solr-display { 13 width: 50%; 14 float: left; 15 display: -ms-flexbox; 16 display: flex; 17 } 18 .solrtab .solr-display div { 19 width: 100%; 20 padding: 20px; 21 border: 1px solid #c0c0c0; 22 } 23 .solrtab .solr-display div h3 { 24 border-bottom: 1px solid #c0c0c0; 25 margin: 0; 26 } 27 .solrtab .solr-display div ul li { 28 display: -ms-flexbox; 29 display: flex; 30 -ms-flex-wrap: wrap; 31 flex-wrap: wrap; 32 border-bottom: 1px dotted #c0c0c0; 33 } 34 .solrtab .solr-display div ul li strong { 35 width: 50%; 36 display: -ms-flexbox; 37 display: flex; 38 } 32 39 33 40 #solr-tabs .nav-tab-active { 34 41 background: #fff; 35 border-bottom: 1px solid #ffffff; } 36 #solr-tabs .nav-tab-active .dashicons { 37 color: #EFD01D; } 42 border-bottom: 1px solid #ffffff; 43 } 44 #solr-tabs .nav-tab-active .dashicons { 45 color: #EFD01D; 46 } 38 47 39 48 .solr-green { 40 color: green; } 49 color: green; 50 } 41 51 42 52 .solr-red { 43 color: red; } 53 color: red; 54 } 44 55 45 56 #solr_header { … … 47 58 border-top: 2px solid #000000; 48 59 border-bottom: 2px solid #000000; 49 background: url("../images/logo.svg") no-repeat 99% #635C27; } 50 #solr_header h2 { 51 color: #fff; 52 padding-left: 10px; 53 font-size: 20px; 54 text-shadow: 1px 1px 5px #000; } 55 #solr_header h2 span { 56 font-size: 9px; } 60 background: url("../images/logo.svg") no-repeat 99% #635C27; 61 } 62 #solr_header h2 { 63 color: #fff; 64 padding-left: 10px; 65 font-size: 20px; 66 text-shadow: 1px 1px 5px #000; 67 } 68 #solr_header h2 span { 69 font-size: 9px; 70 } 57 71 58 72 #wpcontent { 59 padding-left: 0; } 60 #wpcontent #wrap { 61 margin-left: 20px; } 62 #wpcontent div.update-nag { 63 display: none; } 73 padding-left: 0; 74 } 75 #wpcontent #wrap { 76 margin-left: 20px; 77 } 78 #wpcontent div.update-nag { 79 display: none; 80 } 64 81 65 82 #solr_action form { … … 67 84 clear: both; 68 85 display: block; 69 width: 100%; } 86 width: 100%; 87 } 70 88 71 89 #percentspan { … … 73 91 font-weight: bold; 74 92 margin: 20px; 75 padding: 20px; } 93 padding: 20px; 94 } 76 95 77 96 #message { … … 80 99 border-color: #7ad03a; 81 100 box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1); 82 padding: 1px 12px; } 83 #message p { 84 margin: 0.5em 0; 85 padding: 2px; } 101 padding: 1px 12px; 102 } 103 #message p { 104 margin: 0.5em 0; 105 padding: 2px; 106 } 86 107 87 108 .solr-indexing-message { … … 97 118 border-color: #ddd; 98 119 background: #f7f7f7; 99 color: #444; } 120 color: #444; 121 } 100 122 /*# sourceMappingURL=admin.css.map */ -
solr-power/tags/2.6.0/assets/css/admin.css.map
r2896399 r3205064 1 {"version":3,"sources":[" scss/admin.scss"],"names":[],"mappings":"AAAA;EAEE,cAAa,EAmCd;EArCD;IAKI,qBAAa;IAAb,cAAa;IACb,oBAAe;QAAf,gBAAe;IACf,iBAAgB;IAChB,cAAa,EACd;EATH;IAYI,WAAU;IACV,YAAW;IACX,qBAAa;IAAb,cAAa,EAsBd;IApCH;MAgBM,YAAW;MACX,cAAa;MACb,0BAAyB,EAiB1B;MAnCL;QAoBQ,iCAAgC;QAChC,UAAS,EACV;MAtBP;QA0BU,qBAAa;QAAb,cAAa;QACb,oBAAe;YAAf,gBAAe;QACf,kCAAiC,EAKlC;QAjCT;UA8BY,WAAU;UACV,qBAAa;UAAb,cAAa,EACd;;AAOX;EAEI,iBAAgB;EAChB,iCAAgC,EAIjC;EAPH;IAKM,eAAc,EACf;;AAIL;EACE,aAAY,EACb;;AAED;EACE,WAAU,EACX;;AAED;EACE,aAAY;EACZ,8BAA6B;EAC7B,iCAAgC;EAChC,4DAA2D,EAW5D;EAfD;IAMI,YAAW;IACX,mBAAkB;IAClB,gBAAe;IACf,8BAA6B,EAI9B;IAbH;MAWM,eAAc,EACf;;AAKL;EACE,gBAAe,EAOhB;EARD;IAGI,kBAAiB,EAClB;EAJH;IAMI,cAAa,EACd;;AAGH;EACE,YAAW;EACX,YAAW;EACX,eAAc;EACd,YAAW,EACZ;;AAED;EACE,iBAAgB;EAChB,kBAAiB;EACjB,aAAY;EACZ,cACF,EAAC;;AAED;EACE,iBAAgB;EAChB,4BAA2B;EAC3B,sBAAqB;EAErB,2CAA4C;EAC5C,kBAAiB,EAKlB;EAXD;IAQI,gBAAe;IACf,aAAY,EACb;;AAGH;EACE,sBAAqB;EACrB,sBAAqB;EACrB,gBAAe;EACf,kBAAiB;EACjB,aAAY;EACZ,UAAS;EACT,oBAAmB;EACnB,kBAAiB;EACjB,oBAAmB;EACnB,mBAAkB;EAClB,oBAAmB;EACnB,YAAW,EACZ","file":"admin.css"}1 {"version":3,"sources":["file:///home/runner/work/solr-power/solr-power/assets/css/scss/admin.scss","admin.css"],"names":[],"mappings":"AAAA;EAEE,cAAA;CCAD;ADEC;EACE,qBAAA;EAAA,cAAA;EACA,oBAAA;MAAA,gBAAA;EACA,iBAAA;EACA,cAAA;CCAH;ADGC;EACE,WAAA;EACA,YAAA;EACA,qBAAA;EAAA,cAAA;CCDH;ADEG;EACE,YAAA;EACA,cAAA;EACA,0BAAA;CCAL;ADCK;EACE,iCAAA;EACA,UAAA;CCCP;ADGO;EACE,qBAAA;EAAA,cAAA;EACA,oBAAA;MAAA,gBAAA;EACA,kCAAA;CCDT;ADES;EACE,WAAA;EACA,qBAAA;EAAA,cAAA;CCAX;;ADSC;EACE,iBAAA;EACA,iCAAA;CCNH;ADOG;EACE,eAAA;CCLL;;ADUD;EACE,aAAA;CCPD;;ADUD;EACE,WAAA;CCPD;;ADUD;EACE,aAAA;EACA,8BAAA;EACA,iCAAA;EACA,4DAAA;CCPD;ADQC;EACE,YAAA;EACA,mBAAA;EACA,gBAAA;EACA,8BAAA;CCNH;ADOG;EACE,eAAA;CCLL;;ADWD;EACE,gBAAA;CCRD;ADSC;EACE,kBAAA;CCPH;ADSC;EACE,cAAA;CCPH;;ADWD;EACE,YAAA;EACA,YAAA;EACA,eAAA;EACA,YAAA;CCRD;;ADWD;EACE,iBAAA;EACA,kBAAA;EACA,aAAA;EACA,cAAA;CCRD;;ADWD;EACE,iBAAA;EACA,4BAAA;EACA,sBAAA;EAEA,2CAAA;EACA,kBAAA;CCRD;ADSC;EACE,gBAAA;EACA,aAAA;CCPH;;ADWD;EACE,sBAAA;EACA,sBAAA;EACA,gBAAA;EACA,kBAAA;EACA,aAAA;EACA,UAAA;EACA,oBAAA;EACA,kBAAA;EACA,oBAAA;EACA,mBAAA;EACA,oBAAA;EACA,YAAA;CCRD","file":"admin.css"} -
solr-power/tags/2.6.0/assets/css/facet.css
r2896399 r3205064 1 1 #solr-search-results article { 2 margin-bottom: 2em; }3 2 margin-bottom: 2em; 3 } 4 4 #solr-search-results h1 { 5 margin-bottom: 0.25em; } 5 margin-bottom: 0.25em; 6 } 6 7 7 8 #solr_facets a.solr_reset { 8 display: none; } 9 display: none; 10 } 9 11 10 12 #solr-search-loading, … … 12 14 border-radius: 50%; 13 15 width: 10em; 14 height: 10em; } 16 height: 10em; 17 } 15 18 16 19 #solr-search-loading { … … 25 28 -ms-transform: translateZ(0); 26 29 transform: translateZ(0); 27 animation: load8 1.1s infinite linear; }28 30 animation: load8 1.1s infinite linear; 31 } 29 32 @keyframes load8 { 30 33 0% { 31 transform: rotate(0deg); } 34 transform: rotate(0deg); 35 } 32 36 100% { 33 transform: rotate(360deg); } } 37 transform: rotate(360deg); 38 } 39 } 34 40 /*# sourceMappingURL=facet.css.map */ -
solr-power/tags/2.6.0/assets/css/facet.css.map
r2896399 r3205064 1 {"version":3,"sources":[" scss/facet.scss"],"names":[],"mappings":"AAAA;EAEE,mBAAkB,EAClB;;AAHF;EAKE,sBAAqB,EACrB;;AAGF;EAEE,cAAa,EACb;;AAGF;;EAEC,mBAAkB;EAClB,YAAW;EACX,aAAY,EACZ;;AACD;EACC,kBAAiB;EACjB,gBAAe;EACf,mBAAkB;EAClB,qBAAoB;EACpB,iDAAgD;EAChD,mDAAkD;EAClD,oDAAmD;EACnD,iCAAgC;EAEhC,6BAA4B;EAC5B,yBAAwB;EAExB,sCAAqC,EACrC;;AAWD;EACC;IAEC,wBAAuB,EAAA;EAExB;IAEC,0BAAyB,EAAA,EAAA","file":"facet.css"}1 {"version":3,"sources":["file:///home/runner/work/solr-power/solr-power/assets/css/scss/facet.scss","facet.css"],"names":[],"mappings":"AACC;EACC,mBAAA;CCAD;ADEA;EACC,sBAAA;CCAD;;ADKA;EACC,cAAA;CCFD;;ADMD;;EAEC,mBAAA;EACA,YAAA;EACA,aAAA;CCHA;;ADKD;EACC,kBAAA;EACA,gBAAA;EACA,mBAAA;EACA,qBAAA;EACA,iDAAA;EACA,mDAAA;EACA,oDAAA;EACA,iCAAA;EAEA,6BAAA;EACA,yBAAA;EAEA,sCAAA;CCFA;ADcD;EACC;IAEC,wBAAA;GCDC;EDGF;IAEC,0BAAA;GCDC;CACF","file":"facet.css"} -
solr-power/tags/2.6.0/includes/class-solrpower-api.php
r2793662 r3205064 101 101 102 102 /** 103 * Returns the absolute path to look for a custom schema.xml file. 104 * 105 * @return string 106 */ 107 public static function custom_schema_file_path() { 108 $upload_dir = wp_upload_dir(); 109 $custom_schema_file_path = path_join( $upload_dir['basedir'], 'solr-for-wordpress-on-pantheon/schema.xml' ); 110 111 /** 112 * Override the custom schema file path 113 * 114 * @param string $custom_schema_file_path The absolute path to a customer solr schema file. 115 */ 116 $custom_schema_file_path = apply_filters( 'solr_power_customer_schema_file_path', $custom_schema_file_path ); 117 118 return $custom_schema_file_path; 119 } 120 121 /** 103 122 * Submit the schema to Solr. 104 123 */ … … 107 126 * Solarium does not currently support submitting schemas to the server. 108 127 * So we'll do it ourselves. 109 * Let's check for a custom Schema.xml. It MUST be located in 110 * wp-content/uploads/solr-for-wordpress-on-pantheon/schema.xml. 128 * Let's check for a custom Schema.xml. It defaults to 129 * wp-content/uploads/solr-for-wordpress-on-pantheon/schema.xml 130 * and can be overridden with the filter 'solr_power_customer_schema_file_path'. 111 131 */ 112 if ( ! empty( $_ENV['FILEMOUNT'] ) && is_file( realpath( ABSPATH ) . '/' . $_ENV['FILEMOUNT'] . '/solr-for-wordpress-on-pantheon/schema.xml' ) ) { 113 $schema = realpath( ABSPATH ) . '/' . $_ENV['FILEMOUNT'] . '/solr-for-wordpress-on-pantheon/schema.xml'; 114 } else { 115 $schema = SOLR_POWER_PATH . '/schema.xml'; 132 133 $schema = SOLR_POWER_PATH . '/schema.xml'; 134 $custom_schema_file_path = self::custom_schema_file_path(); 135 136 if ( file_exists( $custom_schema_file_path ) ) { 137 $schema = $custom_schema_file_path; 116 138 } 117 139 … … 129 151 130 152 if ( ! file_exists( $schema ) ) { 131 return $schema . ' does not exist.';153 return "Schema '" . $schema . "' does not exist."; 132 154 } 133 155 134 156 if ( ! file_exists( $client_cert ) ) { 135 return $client_cert . ' does not exist.';157 return "Client cert '" . $client_cert . "' does not exist."; 136 158 } 137 159 … … 158 180 fclose( $file ); 159 181 if ( 200 === (int) $curl_opts['http_code'] ) { 182 // Schema Upload Success. 160 183 $return_value = 'Schema Upload Success: ' . $curl_opts['http_code']; 161 } else { 162 $return_value = 'Schema Upload Error: ' . $curl_opts['http_code']; 163 if ( preg_match( '#<h1>(HTTP Status [\d]+ - )?(.+)</h1>#', $response, $matches ) ) { 164 $return_value .= ' - ' . $matches[2]; 165 } 166 } 167 184 if ( $schema == $custom_schema_file_path ) { 185 $return_value = 'Custom ' . $return_value; 186 } 187 return $return_value; 188 } 189 190 // Schema Upload Failure. 191 $return_value = 'Schema Upload Error: ' . $curl_opts['http_code']; 192 if ( preg_match( '#<h1>(HTTP Status [\d]+ - )?(.+)</h1>#', $response, $matches ) ) { 193 $return_value .= ' - ' . $matches[2]; 194 } 168 195 return $return_value; 169 196 } -
solr-power/tags/2.6.0/includes/class-solrpower-wp-query.php
r3076702 r3205064 1252 1252 */ 1253 1253 private function is_solr_query( $query ) { 1254 return $query->is_search() || $query->get( 'solr_integrate' ); 1254 $enabled = $query->is_search() || $query->get( 'solr_integrate' ); 1255 /** 1256 * Filter is_solr_query 1257 * 1258 * Enables the ability to turn off Solr for queries. 1259 * 1260 * @param boolean $enabled Should Solr run for this query? 1261 * @param WP_Query $query The WP_Query. 1262 */ 1263 return apply_filters( 'is_solr_query', $enabled, $query ); 1255 1264 } 1256 1265 -
solr-power/tags/2.6.0/readme.txt
r3076702 r3205064 4 4 Requires at least: 4.6 5 5 Requires PHP: 7.1 6 Tested up to: 6. 5.27 Stable tag: 2. 5.36 Tested up to: 6.7.1 7 Stable tag: 2.6.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 15 [](https://travis-ci.org/pantheon-systems/solr-power)16 15 [](https://circleci.com/gh/pantheon-systems/solr-power) 17 16 … … 206 205 add_filter( 'solr_dismax_query', 'my_solr_dismax_query' ); 207 206 207 = ```is_solr_query``` Filter = 208 209 The `is_solr_query` filter controls whether Solr should be used for a specific query. 210 211 Parameters: 212 213 * $enabled (bool): Indicates whether Solr should be used for the query. Defaults to true if the query is a search or if solr_integrate is set in the query. 214 * $query (WP_Query): The current WordPress query object. 215 216 Return: 217 218 * bool: true to enable Solr for the query, false to disable it. 219 220 add_filter( 'is_solr_query', function( $enabled, $query ) { 221 if ( $query->is_category( 'news' ) ) { 222 return false; 223 } 224 return $enabled; 225 }, 10, 2 ); 226 227 = Custom schema file path = 228 229 By default, custom schema is sourced from `wp-content/uploads/solr-for-wordpress-on-pantheon/schema.xml`. This can be overridden with an absolute path using the the `solr_power_customer_schema_file_path` filter. 230 231 Parameters: 232 * $custom_schema_file_path (string): Default path to a custom schema file 233 234 Return: 235 * string: Absolute path to a custom schema.xml file. 236 237 add_filter('solr_power_customer_schema_file_path', function($custom_schema_file_path) { 238 return '/absolute/path/to/schema.xml'; 239 }); 208 240 209 241 = Common issues = … … 235 267 236 268 == Changelog == 269 270 = 2.6.0 (December 05, 2024) = 271 * Adds `is_solr_query` filter [[#588](https://github.com/pantheon-systems/solr-power/pull/588)] (props [@sboisvert](https://wordpress.org/support/users/sboisvert/)) 272 * Fixes custom schema file path for Composer Managed and other non-standard uploads directories. [[#637](https://github.com/pantheon-systems/solr-power/pull/637)] 273 * Adds filter `solr_power_customer_schema_file_path` to specify an alternative custom schema.xml file. [[#637](https://github.com/pantheon-systems/solr-power/pull/637)] 237 274 238 275 = 2.5.3 (April 24, 2024) = -
solr-power/tags/2.6.0/solr-power.php
r3076702 r3205064 3 3 * Plugin Name: Solr Power 4 4 * Description: Allows WordPress sites to index and search content with ApacheSolr. 5 * Version: 2. 5.35 * Version: 2.6.0 6 6 * Author: Pantheon 7 7 * Author URI: http://pantheon.io … … 11 11 **/ 12 12 13 define( 'SOLR_POWER_VERSION', '2. 5.3' );13 define( 'SOLR_POWER_VERSION', '2.6.0' ); 14 14 15 15 /** -
solr-power/tags/2.6.0/vendor/composer/installed.php
r3076702 r3205064 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 4eb7e163f188620d88ed057f6f2761a5f11bf6c3',6 'reference' => 'ab1a0756ec9799712607fef8287e77605b940487', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' 4eb7e163f188620d88ed057f6f2761a5f11bf6c3',16 'reference' => 'ab1a0756ec9799712607fef8287e77605b940487', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../', -
solr-power/tags/2.6.0/views/options/action.php
r2937900 r3205064 53 53 <tr valign="top"> 54 54 <?php 55 if ( ! empty( $_ENV['FILEMOUNT'] ) ) { 56 $dir = realpath( ABSPATH ) . '/' . $_ENV['FILEMOUNT'] . '/solr-for-wordpress-on-pantheon/'; 57 } else { 58 $upload_dir = wp_upload_dir(); 59 $base_dir = $upload_dir['basedir']; 60 $base_dir = str_replace( ABSPATH, '/', $base_dir ); 61 $dir = $base_dir . '/solr-for-wordpress-on-pantheon/'; 62 } 55 $dir = dirname( SolrPower_Api::custom_schema_file_path() ); 63 56 ?> 64 57 <td scope="row" colspan="2">To use a custom schema.xml, upload it to the -
solr-power/trunk/CHANGELOG.md
r3076702 r3205064 1 1 ## Changelog ## 2 3 ### 2.6.0 (December 05, 2024) ### 4 * Adds `is_solr_query` filter [[#588](https://github.com/pantheon-systems/solr-power/pull/588)] (props [@sboisvert](https://github.com/sboisvert)) 5 * Fixes custom schema file path for Composer Managed and other non-standard uploads directories. [[#637](https://github.com/pantheon-systems/solr-power/pull/637)] 6 * Adds filter `solr_power_customer_schema_file_path` to specify an alternative custom schema.xml file. [[#637](https://github.com/pantheon-systems/solr-power/pull/637)] 2 7 3 8 ### 2.5.3 (April 24, 2024) ### -
solr-power/trunk/assets/css/admin.css
r2896399 r3205064 1 1 .solrtab { 2 display: none; } 3 .solrtab.active { 4 display: -ms-flexbox; 5 display: flex; 6 -ms-flex-wrap: wrap; 7 flex-wrap: wrap; 8 background: #fff; 9 padding: 20px; } 10 .solrtab .solr-display { 11 width: 50%; 12 float: left; 13 display: -ms-flexbox; 14 display: flex; } 15 .solrtab .solr-display div { 16 width: 100%; 17 padding: 20px; 18 border: 1px solid #c0c0c0; } 19 .solrtab .solr-display div h3 { 20 border-bottom: 1px solid #c0c0c0; 21 margin: 0; } 22 .solrtab .solr-display div ul li { 23 display: -ms-flexbox; 24 display: flex; 25 -ms-flex-wrap: wrap; 26 flex-wrap: wrap; 27 border-bottom: 1px dotted #c0c0c0; } 28 .solrtab .solr-display div ul li strong { 29 width: 50%; 30 display: -ms-flexbox; 31 display: flex; } 2 display: none; 3 } 4 .solrtab.active { 5 display: -ms-flexbox; 6 display: flex; 7 -ms-flex-wrap: wrap; 8 flex-wrap: wrap; 9 background: #fff; 10 padding: 20px; 11 } 12 .solrtab .solr-display { 13 width: 50%; 14 float: left; 15 display: -ms-flexbox; 16 display: flex; 17 } 18 .solrtab .solr-display div { 19 width: 100%; 20 padding: 20px; 21 border: 1px solid #c0c0c0; 22 } 23 .solrtab .solr-display div h3 { 24 border-bottom: 1px solid #c0c0c0; 25 margin: 0; 26 } 27 .solrtab .solr-display div ul li { 28 display: -ms-flexbox; 29 display: flex; 30 -ms-flex-wrap: wrap; 31 flex-wrap: wrap; 32 border-bottom: 1px dotted #c0c0c0; 33 } 34 .solrtab .solr-display div ul li strong { 35 width: 50%; 36 display: -ms-flexbox; 37 display: flex; 38 } 32 39 33 40 #solr-tabs .nav-tab-active { 34 41 background: #fff; 35 border-bottom: 1px solid #ffffff; } 36 #solr-tabs .nav-tab-active .dashicons { 37 color: #EFD01D; } 42 border-bottom: 1px solid #ffffff; 43 } 44 #solr-tabs .nav-tab-active .dashicons { 45 color: #EFD01D; 46 } 38 47 39 48 .solr-green { 40 color: green; } 49 color: green; 50 } 41 51 42 52 .solr-red { 43 color: red; } 53 color: red; 54 } 44 55 45 56 #solr_header { … … 47 58 border-top: 2px solid #000000; 48 59 border-bottom: 2px solid #000000; 49 background: url("../images/logo.svg") no-repeat 99% #635C27; } 50 #solr_header h2 { 51 color: #fff; 52 padding-left: 10px; 53 font-size: 20px; 54 text-shadow: 1px 1px 5px #000; } 55 #solr_header h2 span { 56 font-size: 9px; } 60 background: url("../images/logo.svg") no-repeat 99% #635C27; 61 } 62 #solr_header h2 { 63 color: #fff; 64 padding-left: 10px; 65 font-size: 20px; 66 text-shadow: 1px 1px 5px #000; 67 } 68 #solr_header h2 span { 69 font-size: 9px; 70 } 57 71 58 72 #wpcontent { 59 padding-left: 0; } 60 #wpcontent #wrap { 61 margin-left: 20px; } 62 #wpcontent div.update-nag { 63 display: none; } 73 padding-left: 0; 74 } 75 #wpcontent #wrap { 76 margin-left: 20px; 77 } 78 #wpcontent div.update-nag { 79 display: none; 80 } 64 81 65 82 #solr_action form { … … 67 84 clear: both; 68 85 display: block; 69 width: 100%; } 86 width: 100%; 87 } 70 88 71 89 #percentspan { … … 73 91 font-weight: bold; 74 92 margin: 20px; 75 padding: 20px; } 93 padding: 20px; 94 } 76 95 77 96 #message { … … 80 99 border-color: #7ad03a; 81 100 box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1); 82 padding: 1px 12px; } 83 #message p { 84 margin: 0.5em 0; 85 padding: 2px; } 101 padding: 1px 12px; 102 } 103 #message p { 104 margin: 0.5em 0; 105 padding: 2px; 106 } 86 107 87 108 .solr-indexing-message { … … 97 118 border-color: #ddd; 98 119 background: #f7f7f7; 99 color: #444; } 120 color: #444; 121 } 100 122 /*# sourceMappingURL=admin.css.map */ -
solr-power/trunk/assets/css/admin.css.map
r2896399 r3205064 1 {"version":3,"sources":[" scss/admin.scss"],"names":[],"mappings":"AAAA;EAEE,cAAa,EAmCd;EArCD;IAKI,qBAAa;IAAb,cAAa;IACb,oBAAe;QAAf,gBAAe;IACf,iBAAgB;IAChB,cAAa,EACd;EATH;IAYI,WAAU;IACV,YAAW;IACX,qBAAa;IAAb,cAAa,EAsBd;IApCH;MAgBM,YAAW;MACX,cAAa;MACb,0BAAyB,EAiB1B;MAnCL;QAoBQ,iCAAgC;QAChC,UAAS,EACV;MAtBP;QA0BU,qBAAa;QAAb,cAAa;QACb,oBAAe;YAAf,gBAAe;QACf,kCAAiC,EAKlC;QAjCT;UA8BY,WAAU;UACV,qBAAa;UAAb,cAAa,EACd;;AAOX;EAEI,iBAAgB;EAChB,iCAAgC,EAIjC;EAPH;IAKM,eAAc,EACf;;AAIL;EACE,aAAY,EACb;;AAED;EACE,WAAU,EACX;;AAED;EACE,aAAY;EACZ,8BAA6B;EAC7B,iCAAgC;EAChC,4DAA2D,EAW5D;EAfD;IAMI,YAAW;IACX,mBAAkB;IAClB,gBAAe;IACf,8BAA6B,EAI9B;IAbH;MAWM,eAAc,EACf;;AAKL;EACE,gBAAe,EAOhB;EARD;IAGI,kBAAiB,EAClB;EAJH;IAMI,cAAa,EACd;;AAGH;EACE,YAAW;EACX,YAAW;EACX,eAAc;EACd,YAAW,EACZ;;AAED;EACE,iBAAgB;EAChB,kBAAiB;EACjB,aAAY;EACZ,cACF,EAAC;;AAED;EACE,iBAAgB;EAChB,4BAA2B;EAC3B,sBAAqB;EAErB,2CAA4C;EAC5C,kBAAiB,EAKlB;EAXD;IAQI,gBAAe;IACf,aAAY,EACb;;AAGH;EACE,sBAAqB;EACrB,sBAAqB;EACrB,gBAAe;EACf,kBAAiB;EACjB,aAAY;EACZ,UAAS;EACT,oBAAmB;EACnB,kBAAiB;EACjB,oBAAmB;EACnB,mBAAkB;EAClB,oBAAmB;EACnB,YAAW,EACZ","file":"admin.css"}1 {"version":3,"sources":["file:///home/runner/work/solr-power/solr-power/assets/css/scss/admin.scss","admin.css"],"names":[],"mappings":"AAAA;EAEE,cAAA;CCAD;ADEC;EACE,qBAAA;EAAA,cAAA;EACA,oBAAA;MAAA,gBAAA;EACA,iBAAA;EACA,cAAA;CCAH;ADGC;EACE,WAAA;EACA,YAAA;EACA,qBAAA;EAAA,cAAA;CCDH;ADEG;EACE,YAAA;EACA,cAAA;EACA,0BAAA;CCAL;ADCK;EACE,iCAAA;EACA,UAAA;CCCP;ADGO;EACE,qBAAA;EAAA,cAAA;EACA,oBAAA;MAAA,gBAAA;EACA,kCAAA;CCDT;ADES;EACE,WAAA;EACA,qBAAA;EAAA,cAAA;CCAX;;ADSC;EACE,iBAAA;EACA,iCAAA;CCNH;ADOG;EACE,eAAA;CCLL;;ADUD;EACE,aAAA;CCPD;;ADUD;EACE,WAAA;CCPD;;ADUD;EACE,aAAA;EACA,8BAAA;EACA,iCAAA;EACA,4DAAA;CCPD;ADQC;EACE,YAAA;EACA,mBAAA;EACA,gBAAA;EACA,8BAAA;CCNH;ADOG;EACE,eAAA;CCLL;;ADWD;EACE,gBAAA;CCRD;ADSC;EACE,kBAAA;CCPH;ADSC;EACE,cAAA;CCPH;;ADWD;EACE,YAAA;EACA,YAAA;EACA,eAAA;EACA,YAAA;CCRD;;ADWD;EACE,iBAAA;EACA,kBAAA;EACA,aAAA;EACA,cAAA;CCRD;;ADWD;EACE,iBAAA;EACA,4BAAA;EACA,sBAAA;EAEA,2CAAA;EACA,kBAAA;CCRD;ADSC;EACE,gBAAA;EACA,aAAA;CCPH;;ADWD;EACE,sBAAA;EACA,sBAAA;EACA,gBAAA;EACA,kBAAA;EACA,aAAA;EACA,UAAA;EACA,oBAAA;EACA,kBAAA;EACA,oBAAA;EACA,mBAAA;EACA,oBAAA;EACA,YAAA;CCRD","file":"admin.css"} -
solr-power/trunk/assets/css/facet.css
r2896399 r3205064 1 1 #solr-search-results article { 2 margin-bottom: 2em; }3 2 margin-bottom: 2em; 3 } 4 4 #solr-search-results h1 { 5 margin-bottom: 0.25em; } 5 margin-bottom: 0.25em; 6 } 6 7 7 8 #solr_facets a.solr_reset { 8 display: none; } 9 display: none; 10 } 9 11 10 12 #solr-search-loading, … … 12 14 border-radius: 50%; 13 15 width: 10em; 14 height: 10em; } 16 height: 10em; 17 } 15 18 16 19 #solr-search-loading { … … 25 28 -ms-transform: translateZ(0); 26 29 transform: translateZ(0); 27 animation: load8 1.1s infinite linear; }28 30 animation: load8 1.1s infinite linear; 31 } 29 32 @keyframes load8 { 30 33 0% { 31 transform: rotate(0deg); } 34 transform: rotate(0deg); 35 } 32 36 100% { 33 transform: rotate(360deg); } } 37 transform: rotate(360deg); 38 } 39 } 34 40 /*# sourceMappingURL=facet.css.map */ -
solr-power/trunk/assets/css/facet.css.map
r2896399 r3205064 1 {"version":3,"sources":[" scss/facet.scss"],"names":[],"mappings":"AAAA;EAEE,mBAAkB,EAClB;;AAHF;EAKE,sBAAqB,EACrB;;AAGF;EAEE,cAAa,EACb;;AAGF;;EAEC,mBAAkB;EAClB,YAAW;EACX,aAAY,EACZ;;AACD;EACC,kBAAiB;EACjB,gBAAe;EACf,mBAAkB;EAClB,qBAAoB;EACpB,iDAAgD;EAChD,mDAAkD;EAClD,oDAAmD;EACnD,iCAAgC;EAEhC,6BAA4B;EAC5B,yBAAwB;EAExB,sCAAqC,EACrC;;AAWD;EACC;IAEC,wBAAuB,EAAA;EAExB;IAEC,0BAAyB,EAAA,EAAA","file":"facet.css"}1 {"version":3,"sources":["file:///home/runner/work/solr-power/solr-power/assets/css/scss/facet.scss","facet.css"],"names":[],"mappings":"AACC;EACC,mBAAA;CCAD;ADEA;EACC,sBAAA;CCAD;;ADKA;EACC,cAAA;CCFD;;ADMD;;EAEC,mBAAA;EACA,YAAA;EACA,aAAA;CCHA;;ADKD;EACC,kBAAA;EACA,gBAAA;EACA,mBAAA;EACA,qBAAA;EACA,iDAAA;EACA,mDAAA;EACA,oDAAA;EACA,iCAAA;EAEA,6BAAA;EACA,yBAAA;EAEA,sCAAA;CCFA;ADcD;EACC;IAEC,wBAAA;GCDC;EDGF;IAEC,0BAAA;GCDC;CACF","file":"facet.css"} -
solr-power/trunk/includes/class-solrpower-api.php
r2793662 r3205064 101 101 102 102 /** 103 * Returns the absolute path to look for a custom schema.xml file. 104 * 105 * @return string 106 */ 107 public static function custom_schema_file_path() { 108 $upload_dir = wp_upload_dir(); 109 $custom_schema_file_path = path_join( $upload_dir['basedir'], 'solr-for-wordpress-on-pantheon/schema.xml' ); 110 111 /** 112 * Override the custom schema file path 113 * 114 * @param string $custom_schema_file_path The absolute path to a customer solr schema file. 115 */ 116 $custom_schema_file_path = apply_filters( 'solr_power_customer_schema_file_path', $custom_schema_file_path ); 117 118 return $custom_schema_file_path; 119 } 120 121 /** 103 122 * Submit the schema to Solr. 104 123 */ … … 107 126 * Solarium does not currently support submitting schemas to the server. 108 127 * So we'll do it ourselves. 109 * Let's check for a custom Schema.xml. It MUST be located in 110 * wp-content/uploads/solr-for-wordpress-on-pantheon/schema.xml. 128 * Let's check for a custom Schema.xml. It defaults to 129 * wp-content/uploads/solr-for-wordpress-on-pantheon/schema.xml 130 * and can be overridden with the filter 'solr_power_customer_schema_file_path'. 111 131 */ 112 if ( ! empty( $_ENV['FILEMOUNT'] ) && is_file( realpath( ABSPATH ) . '/' . $_ENV['FILEMOUNT'] . '/solr-for-wordpress-on-pantheon/schema.xml' ) ) { 113 $schema = realpath( ABSPATH ) . '/' . $_ENV['FILEMOUNT'] . '/solr-for-wordpress-on-pantheon/schema.xml'; 114 } else { 115 $schema = SOLR_POWER_PATH . '/schema.xml'; 132 133 $schema = SOLR_POWER_PATH . '/schema.xml'; 134 $custom_schema_file_path = self::custom_schema_file_path(); 135 136 if ( file_exists( $custom_schema_file_path ) ) { 137 $schema = $custom_schema_file_path; 116 138 } 117 139 … … 129 151 130 152 if ( ! file_exists( $schema ) ) { 131 return $schema . ' does not exist.';153 return "Schema '" . $schema . "' does not exist."; 132 154 } 133 155 134 156 if ( ! file_exists( $client_cert ) ) { 135 return $client_cert . ' does not exist.';157 return "Client cert '" . $client_cert . "' does not exist."; 136 158 } 137 159 … … 158 180 fclose( $file ); 159 181 if ( 200 === (int) $curl_opts['http_code'] ) { 182 // Schema Upload Success. 160 183 $return_value = 'Schema Upload Success: ' . $curl_opts['http_code']; 161 } else { 162 $return_value = 'Schema Upload Error: ' . $curl_opts['http_code']; 163 if ( preg_match( '#<h1>(HTTP Status [\d]+ - )?(.+)</h1>#', $response, $matches ) ) { 164 $return_value .= ' - ' . $matches[2]; 165 } 166 } 167 184 if ( $schema == $custom_schema_file_path ) { 185 $return_value = 'Custom ' . $return_value; 186 } 187 return $return_value; 188 } 189 190 // Schema Upload Failure. 191 $return_value = 'Schema Upload Error: ' . $curl_opts['http_code']; 192 if ( preg_match( '#<h1>(HTTP Status [\d]+ - )?(.+)</h1>#', $response, $matches ) ) { 193 $return_value .= ' - ' . $matches[2]; 194 } 168 195 return $return_value; 169 196 } -
solr-power/trunk/includes/class-solrpower-wp-query.php
r3076702 r3205064 1252 1252 */ 1253 1253 private function is_solr_query( $query ) { 1254 return $query->is_search() || $query->get( 'solr_integrate' ); 1254 $enabled = $query->is_search() || $query->get( 'solr_integrate' ); 1255 /** 1256 * Filter is_solr_query 1257 * 1258 * Enables the ability to turn off Solr for queries. 1259 * 1260 * @param boolean $enabled Should Solr run for this query? 1261 * @param WP_Query $query The WP_Query. 1262 */ 1263 return apply_filters( 'is_solr_query', $enabled, $query ); 1255 1264 } 1256 1265 -
solr-power/trunk/readme.txt
r3076702 r3205064 4 4 Requires at least: 4.6 5 5 Requires PHP: 7.1 6 Tested up to: 6. 5.27 Stable tag: 2. 5.36 Tested up to: 6.7.1 7 Stable tag: 2.6.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 15 [](https://travis-ci.org/pantheon-systems/solr-power)16 15 [](https://circleci.com/gh/pantheon-systems/solr-power) 17 16 … … 206 205 add_filter( 'solr_dismax_query', 'my_solr_dismax_query' ); 207 206 207 = ```is_solr_query``` Filter = 208 209 The `is_solr_query` filter controls whether Solr should be used for a specific query. 210 211 Parameters: 212 213 * $enabled (bool): Indicates whether Solr should be used for the query. Defaults to true if the query is a search or if solr_integrate is set in the query. 214 * $query (WP_Query): The current WordPress query object. 215 216 Return: 217 218 * bool: true to enable Solr for the query, false to disable it. 219 220 add_filter( 'is_solr_query', function( $enabled, $query ) { 221 if ( $query->is_category( 'news' ) ) { 222 return false; 223 } 224 return $enabled; 225 }, 10, 2 ); 226 227 = Custom schema file path = 228 229 By default, custom schema is sourced from `wp-content/uploads/solr-for-wordpress-on-pantheon/schema.xml`. This can be overridden with an absolute path using the the `solr_power_customer_schema_file_path` filter. 230 231 Parameters: 232 * $custom_schema_file_path (string): Default path to a custom schema file 233 234 Return: 235 * string: Absolute path to a custom schema.xml file. 236 237 add_filter('solr_power_customer_schema_file_path', function($custom_schema_file_path) { 238 return '/absolute/path/to/schema.xml'; 239 }); 208 240 209 241 = Common issues = … … 235 267 236 268 == Changelog == 269 270 = 2.6.0 (December 05, 2024) = 271 * Adds `is_solr_query` filter [[#588](https://github.com/pantheon-systems/solr-power/pull/588)] (props [@sboisvert](https://wordpress.org/support/users/sboisvert/)) 272 * Fixes custom schema file path for Composer Managed and other non-standard uploads directories. [[#637](https://github.com/pantheon-systems/solr-power/pull/637)] 273 * Adds filter `solr_power_customer_schema_file_path` to specify an alternative custom schema.xml file. [[#637](https://github.com/pantheon-systems/solr-power/pull/637)] 237 274 238 275 = 2.5.3 (April 24, 2024) = -
solr-power/trunk/solr-power.php
r3076702 r3205064 3 3 * Plugin Name: Solr Power 4 4 * Description: Allows WordPress sites to index and search content with ApacheSolr. 5 * Version: 2. 5.35 * Version: 2.6.0 6 6 * Author: Pantheon 7 7 * Author URI: http://pantheon.io … … 11 11 **/ 12 12 13 define( 'SOLR_POWER_VERSION', '2. 5.3' );13 define( 'SOLR_POWER_VERSION', '2.6.0' ); 14 14 15 15 /** -
solr-power/trunk/vendor/composer/installed.php
r3076702 r3205064 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 4eb7e163f188620d88ed057f6f2761a5f11bf6c3',6 'reference' => 'ab1a0756ec9799712607fef8287e77605b940487', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' 4eb7e163f188620d88ed057f6f2761a5f11bf6c3',16 'reference' => 'ab1a0756ec9799712607fef8287e77605b940487', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../', -
solr-power/trunk/views/options/action.php
r2937900 r3205064 53 53 <tr valign="top"> 54 54 <?php 55 if ( ! empty( $_ENV['FILEMOUNT'] ) ) { 56 $dir = realpath( ABSPATH ) . '/' . $_ENV['FILEMOUNT'] . '/solr-for-wordpress-on-pantheon/'; 57 } else { 58 $upload_dir = wp_upload_dir(); 59 $base_dir = $upload_dir['basedir']; 60 $base_dir = str_replace( ABSPATH, '/', $base_dir ); 61 $dir = $base_dir . '/solr-for-wordpress-on-pantheon/'; 62 } 55 $dir = dirname( SolrPower_Api::custom_schema_file_path() ); 63 56 ?> 64 57 <td scope="row" colspan="2">To use a custom schema.xml, upload it to the
Note: See TracChangeset
for help on using the changeset viewer.