Skip to content
GitLab
Explore
Sign in
WordPress plugins
Word Count
Compare revisions
71c98d772f89eb1942ccfef1dde27499fd8a0bc9 to 4924023dbf09fde006b58d0a91949a7d0effdd82
Commits on Source (3)
New name.
· 469d803a
Canek Peláez Valdés
authored
Jun 07, 2022
469d803a
New name.
· a76a6633
Canek Peláez Valdés
authored
Jun 07, 2022
a76a6633
Update translation.
· 4924023d
Canek Peláez Valdés
authored
Jun 07, 2022
4924023d
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
4924023d
...
@@ -7,27 +7,27 @@ posts and pages, and to show reports on that counting.
...
@@ -7,27 +7,27 @@ posts and pages, and to show reports on that counting.
Counting words
Counting words
--------------
--------------
![
word-counting
](
https://aztlan.fciencias.unam.mx/gitlab/canek/word-count/-/wikis/uploads/3d66d398842ccf58ca565136ca29927c/word-counting.png
)
![
word-counting
](
https://aztlan.fciencias.unam.mx/gitlab/canek/
free-
word-count/-/wikis/uploads/3d66d398842ccf58ca565136ca29927c/word-counting.png
)
Statistics
Statistics
----------
----------
![
statistics
](
https://aztlan.fciencias.unam.mx/gitlab/canek/word-count/-/wikis/uploads/6c2ddb6780ca0c38cff2ec95e362b2c0/statistics.png
)
![
statistics
](
https://aztlan.fciencias.unam.mx/gitlab/canek/
free-
word-count/-/wikis/uploads/6c2ddb6780ca0c38cff2ec95e362b2c0/statistics.png
)
Tables
Tables
------
------
![
tables
](
https://aztlan.fciencias.unam.mx/gitlab/canek/word-count/-/wikis/uploads/4b1675be1712ff16072b75d4b99b28cc/tables.png
)
![
tables
](
https://aztlan.fciencias.unam.mx/gitlab/canek/
free-
word-count/-/wikis/uploads/4b1675be1712ff16072b75d4b99b28cc/tables.png
)
Bar charts
Bar charts
----------
----------
![
bar-charts
](
https://aztlan.fciencias.unam.mx/gitlab/canek/word-count/-/wikis/uploads/62a666528dcedc9fcdb12243985760c0/bar-charts.png
)
![
bar-charts
](
https://aztlan.fciencias.unam.mx/gitlab/canek/
free-
word-count/-/wikis/uploads/62a666528dcedc9fcdb12243985760c0/bar-charts.png
)
Pie charts
Pie charts
----------
----------
![
pie-charts
](
https://aztlan.fciencias.unam.mx/gitlab/canek/word-count/-/wikis/uploads/f8aa3f9afa8e1f0045d6a443a961fc3b/pie-charts.png
)
![
pie-charts
](
https://aztlan.fciencias.unam.mx/gitlab/canek/
free-
word-count/-/wikis/uploads/f8aa3f9afa8e1f0045d6a443a961fc3b/pie-charts.png
)
The charts in the reports are created using the
The charts in the reports are created using the
[
apexcharts
](
https://apexcharts.com/
)
library, available under the MIT license.
[
apexcharts
](
https://apexcharts.com/
)
library, available under the MIT license.
...
@@ -36,11 +36,11 @@ The charts in the reports are created using the
...
@@ -36,11 +36,11 @@ The charts in the reports are created using the
Installation
Installation
------------
------------
Put the
`word-count`
directory in
`${WPDIR}/wp-content/plugins`
and
activate it
Put the
`
free-
word-count`
directory in
`${WPDIR}/wp-content/plugins`
and
in the plugins section of the admin page. The first time you visit
the "Word
activate it
in the plugins section of the admin page. The first time you visit
count" section, the plugin will start to automatically count the
words of all
the "Word
count" section, the plugin will start to automatically count the
the published posts and pages. How long will it take depends on
the server
words of all
the published posts and pages. How long will it take depends on
machine and the number of posts and pages.
the server
machine and the number of posts and pages.
After that, the word count will be automatically updated when you publish posts
After that, the word count will be automatically updated when you publish posts
and pages; but if you feel is necessary you can trigger the count manually
and pages; but if you feel is necessary you can trigger the count manually
...
...
languages/es_MX.po
View file @
4924023d
...
@@ -185,14 +185,14 @@ msgstr "Palabras en entradas:"
...
@@ -185,14 +185,14 @@ msgstr "Palabras en entradas:"
msgid "Total words:"
msgid "Total words:"
msgstr "Total de palabras:"
msgstr "Total de palabras:"
#: datetime-chart.php:26 top-20-tables.php:81
word-coun
t.php:
21
#: datetime-chart.php:26 top-20-tables.php:81
datetime-char
t.php:
53
#:
datetime-chart.php:53
datetime-chart.php:52 datetime-chart.php:55
#: datetime-chart.php:52 datetime-chart.php:55
free-word-count.php:21
#:
free-word-count.php:21
top-20-tables.php:119
#: top-20-tables.php:119
msgid "Word count"
msgid "Word count"
msgstr "Número de palabras"
msgstr "Número de palabras"
#:
word-count.php:21
tab-barcharts.php:8 tab-piecharts.php:8 tab-stats.php:10
#: tab-barcharts.php:8 tab-piecharts.php:8 tab-stats.php:10
tab-tables.php:8
#:
tab-tables.php:8
word-count.php:20 tab-stats.php:15 free-word-count.php:20
#: word-count.php:20 tab-stats.php:15 free-word-count.php:20
#: tab-barcharts.php:5 tab-piecharts.php:5 tab-stats.php:19 tab-tables.php:5
#: tab-barcharts.php:5 tab-piecharts.php:5 tab-stats.php:19 tab-tables.php:5
msgid "Word count and statistics for posts and pages"
msgid "Word count and statistics for posts and pages"
msgstr "Número de palabras y estadísticas para entradas y páginas"
msgstr "Número de palabras y estadísticas para entradas y páginas"
...
...
page.php
View file @
4924023d
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
define
(
'WC_ROWS_PER_PAGE'
,
20
);
define
(
'WC_ROWS_PER_PAGE'
,
20
);
global
$wpdb
;
global
$wpdb
;
$taburl
=
get_site_url
()
.
'/wp-admin/admin.php?page=word-count&wc-tab='
;
$taburl
=
get_site_url
()
.
'/wp-admin/admin.php?page=
free-
word-count&wc-tab='
;
function
get_wc_tab
()
{
function
get_wc_tab
()
{
$wc_tab
=
!
empty
(
$_GET
[
"wc-tab"
])
?
$_GET
[
"wc-tab"
]
:
'tab-stats'
;
$wc_tab
=
!
empty
(
$_GET
[
"wc-tab"
])
?
$_GET
[
"wc-tab"
]
:
'tab-stats'
;
...
@@ -18,7 +18,7 @@ function get_wc_tab() {
...
@@ -18,7 +18,7 @@ function get_wc_tab() {
function
echoPage
(
$type
,
$page
,
$current
,
$sep
=
' | '
,
$filter
=
''
)
{
function
echoPage
(
$type
,
$page
,
$current
,
$sep
=
' | '
,
$filter
=
''
)
{
$wc_tab
=
get_wc_tab
();
$wc_tab
=
get_wc_tab
();
$url
=
get_site_url
()
.
'/wp-admin/admin.php?page=word-count'
$url
=
get_site_url
()
.
'/wp-admin/admin.php?page=
free-
word-count'
.
"&wc-tab=
$wc_tab
&wc-
$type
-page=
$page
"
;
.
"&wc-tab=
$wc_tab
&wc-
$type
-page=
$page
"
;
if
(
$filter
!=
''
)
{
if
(
$filter
!=
''
)
{
$url
=
$url
.
"&wc-
$type
-filter=
$filter
"
;
$url
=
$url
.
"&wc-
$type
-filter=
$filter
"
;
...
@@ -105,9 +105,9 @@ class WordCounter {
...
@@ -105,9 +105,9 @@ class WordCounter {
this
.
intervalId
=
-
1
;
this
.
intervalId
=
-
1
;
this
.
progressValue
=
0
;
this
.
progressValue
=
0
;
this
.
baseUrl
=
siteUrl
+
this
.
baseUrl
=
siteUrl
+
'
/wp-content/plugins/word-count/word-count-progress.php?
'
+
'
/wp-content/plugins/
free-
word-count/
free-
word-count-progress.php?
'
+
'
key=
'
+
key
+
'
&total=
'
+
total
;
'
key=
'
+
key
+
'
&total=
'
+
total
;
this
.
relocateUrl
=
siteUrl
+
'
/wp-admin/admin.php?page=word-count
'
;
this
.
relocateUrl
=
siteUrl
+
'
/wp-admin/admin.php?page=
free-
word-count
'
;
}
}
launchInterval
()
{
launchInterval
()
{
...
...
tab-stats.php
View file @
4924023d
<?php
<?php
$base_url
=
get_site_url
()
.
'/wp-content/plugins/word-count'
;
$base_url
=
get_site_url
()
.
'/wp-content/plugins/
free-
word-count'
;
$sql
=
$wpdb
->
prepare
(
"SELECT SUM(CAST(
{
$wpdb
->
postmeta
}
.meta_value AS UNSIGNED)) AS total
$sql
=
$wpdb
->
prepare
(
"SELECT SUM(CAST(
{
$wpdb
->
postmeta
}
.meta_value AS UNSIGNED)) AS total
FROM
{
$wpdb
->
posts
}
,
{
$wpdb
->
postmeta
}
FROM
{
$wpdb
->
posts
}
,
{
$wpdb
->
postmeta
}
...
...
top-20-barcharts.php
View file @
4924023d
...
@@ -66,7 +66,7 @@ if ($wc_filter == '') {
...
@@ -66,7 +66,7 @@ if ($wc_filter == '') {
$results
=
$wpdb
->
get_results
(
$sql
);
$results
=
$wpdb
->
get_results
(
$sql
);
$n
=
$wpdb
->
num_rows
;
$n
=
$wpdb
->
num_rows
;
$base_url
=
get_site_url
()
.
'/wp-content/plugins/word-count'
;
$base_url
=
get_site_url
()
.
'/wp-content/plugins/
free-
word-count'
;
?>
?>
<script
src=
"
<?php
echo
$base_url
;
?>
/apexcharts/apexcharts.js"
></script>
<script
src=
"
<?php
echo
$base_url
;
?>
/apexcharts/apexcharts.js"
></script>
<div
class=
"wc_section"
>
<div
class=
"wc_section"
>
...
...
top-20-piecharts.php
View file @
4924023d
...
@@ -5,7 +5,7 @@ $wc_page = !empty($_GET["wc-$post_type-page"]) ?
...
@@ -5,7 +5,7 @@ $wc_page = !empty($_GET["wc-$post_type-page"]) ?
$wc_filter
=
!
empty
(
$_GET
[
"wc-
$post_type
-filter"
])
?
$wc_filter
=
!
empty
(
$_GET
[
"wc-
$post_type
-filter"
])
?
$_GET
[
"wc-
$post_type
-filter"
]
:
''
;
$_GET
[
"wc-
$post_type
-filter"
]
:
''
;
$base_url
=
get_site_url
()
.
'/wp-content/plugins/word-count'
;
$base_url
=
get_site_url
()
.
'/wp-content/plugins/
free-
word-count'
;
$sql
=
''
;
$sql
=
''
;
if
(
$wc_filter
==
''
)
{
if
(
$wc_filter
==
''
)
{
...
...